Bonjour à tous

Je viens a vous avec un problème qui me semblais tout simple, et pour tant.
Il m'avais semblé voir un poste sur le sujet dans le forum, mais je ne l'ais pas retrouvé.
Dans une appli, j'inserts dynamiquement des contrôles par l'intermédiaire d'une form de saisie.
Je place une frame (Fr_T) avec un titre (Titre_Lg). dans la frame j'inserts des Images (Image) et des Textes (text_Image).
Ma form peut contenir plusieurs frame différencier par leur index. Chaque frame peut contenir 1 à plusieurs images et textes différencier par leur index.
Jusque la rien d'extraordinaire.

Le problème ais de pouvoir retrouver le plus petit et le plus grand index d'une frame.

J'ais bien essayé .Lbound et .Ubound, mais sans succès. J'ais essayé d'utiliser .Container mais la aussi sans succès.
J'ais pensée renommer mes contrôles à l'insertion mais cela me pose un problème pour la suite de mon appli. (Traitement de tout les contrôles)

Voici le code qui me sert a insérer mes contrôles :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Dim Str_P1, Str_P2 As Long
 
        Nb2 = F_0.Fr_T.UBound + 1
        Nb1 = F_0.Image.UBound + 1
        Load F_0.Fr_ T (Nb2)
        If Ch_Lg(1).Value = 1 Then
            Load F_0.Titre_Lg(Nb2)
        End If
        F_0.Fr_ T (Nb2).Visible = True
        If Ch_Lg(1).Value = 1 Then
            F_0.Titre_Lg(Nb2).Visible = True
        End If
        F_0.Fr_ T (Nb2).Top = F_0.Fr_ T (Nb2 - 1).Top + F_0.Fr_ T (Nb2 - 1).Height + 100
        If Ch_Lg(1).Value = 1 Then
            F_0.Titre_Lg(Nb2).Top = F_0.Fr_ T (Nb2).Top - F_0.Titre_Lg(Nb2).Height - 50
            F_0.Titre_Lg(Nb2).Width = F_0.Fr_ T (Nb2).Width
        End If
 
        Str_P1 = ((F_0.Fr_ T (Nb2).Width - (Text_Lg(0).Text * (Replace(Text_Lg(2).Text, ".", ",") * 512))) / Text_Lg(0).Text)
        Str_P2 = ((F_0.Fr_ T (Nb2).Width - (Text_Lg(0).Text * (Replace(Text_Lg(2).Text, ".", ",") * 512))) / 2)
 
        For LL = Nb1 To (Nb1 + Text_Lg(0) - 1)
            Load F_0. Image (LL)
            Load F_0.Text_ Image (LL)
 
            F_0. Image (LL).Visible = True
            F_0.Text_ Image (LL).Visible = True
 
            Set F_0. Image (LL).Container = F_0.Fr_ T (Nb2)
            Set F_0.Text_ Image (LL).Container = F_0.Fr_ T (Nb2)
            F_0. Image (LL).Height = Round(Replace(Text_Lg(1).Text, ".", ",") * 512, 1)
            F_0. Image (LL).Width = Round(Replace(Text_Lg(2).Text, ".", ",") * 512, 1)
 
            F_0. Image (LL).Top = 150
 
            If Ch_Lg(0).Value = 0 Then
                If LL = Nb1 Then
                    F_0. Image (LL).Left = Str_P1 / 2
                Else
                    F_0. Image (LL).Left = F_0. Image (LL - 1).Left + F_0. Image (LL - 1).Width + Str_P1
                End If
            End If
 
            If Ch_Lg(0).Value = 1 Then
                If LL = Nb1 Then
                    F_0. Image (LL).Left = Str_P2
                Else
                    F_0. Image (LL).Left = F_0. Image (LL - 1).Left + F_0. Image (LL - 1).Width
                End If
            End If
 
            F_0.Text_ Image (LL).Top = F_0. Image (LL).Top + F_0. Image (LL).Height + 5
            F_0.Text_ Image (LL).Left = F_0. Image (LL).Left
            F_0.Text_ Image (LL).Width = F_0. Image (LL).Width
            F_0.Text_ Image (LL) = LL
            F_0.Fr_ T (Nb2).Height = F_0. Image (LL).Height + F_0.Text_ Image (LL).Height + 200
        Next
Vous remerciant par avance de votre aide,

BM42