Textbox dans une frame
Balou
-
Balou -
Balou -
Bonjour à tous, besoin de votre aide et apprendre
Novice en VBA je cherche malgré tout à construire un fichier dans lequel je souhaite utiliser un userform.
Après une recherche sur le net j’ai réalisé un userform dans lequel s’affichent en fonction d’une variable plusieurs textbox.
Jusqu’à la tout fonctionne.
Maintenant je souhaiterais que les textbox s’intègre dans dans une frame.
Mais les textbox s’affichent en dehors de la frame
Voici le code , merci pour vos suggestions.
Merci pour votre aide, bonne journée.
Novice en VBA je cherche malgré tout à construire un fichier dans lequel je souhaite utiliser un userform.
Après une recherche sur le net j’ai réalisé un userform dans lequel s’affichent en fonction d’une variable plusieurs textbox.
Jusqu’à la tout fonctionne.
Maintenant je souhaiterais que les textbox s’intègre dans dans une frame.
Mais les textbox s’affichent en dehors de la frame
Voici le code , merci pour vos suggestions.
Incr = 8
PosX = 120
For i = 1 To nbcells 'boucle pour la création des TextBox
Set Obj = Me.Controls.Add("forms.Frame.1")
With Obj
.Caption = "TRACABILITE"
.Font.Bold = True
.Left = 6
.Top = 126
.Width = 114
.Height = 100
Set Obj = Me.Controls.Add("forms.TextBox.1")
With Obj
.Name = "TextBox" & i
.Object.Value = " "
.Left = PosX
.Top = 30 * ((i - 1) Mod 10) + 40
.Width = 100
.Height = 20
End With
'ajout de l'objet dans la classe
Set Cl = New Classe1
Set Cl.TextBox = Obj
Collect.Add Cl
If i Mod 10 = 0 Then PosX = PosX + 150
Incr = Incr + 1
End With
Next i
Merci pour votre aide, bonne journée.
A voir également:
- Textbox dans une frame
- Photo frame studio - Télécharger - Retouche d'image
- Vba textbox date format dd/mm/yyyy - Forum VB / VBA
- Frame host c'est quoi ✓ - Forum HTML
- Good frame - Télécharger - Photo & Graphisme
- Frame network 2.0 - Télécharger - Divers Utilitaires
4 réponses
Ceci devrait mieux fonctionner
Set Frame1 = Me.Controls.Add("forms.Frame.1")
With Frame1
.Caption = "TRACABILITE"
.Font.Bold = True
.Left = 6
.Top = 126
.Width = 114
.Height = 100
End With
For i = 1 To nbcells
Set Obj = Frame1.Controls.Add("forms.TextBox.1")
With Obj
.Name = "TextBox" & i
.Object.Value = " "
.Left = PosX
.Top = 30 * ((i - 1) Mod 10) + 40
.Width = 100
.Height = 20
End With
Next i
Bonjour,
Essayer ceci
Essayer ceci
--
Set Obj = Me.Controls.Add("forms.Frame1")
With Obj
.Caption = "TRACABILITE"
.Font.Bold = True
.Left = 6
.Top = 126
.Width = 114
.Height = 100
End With
Set Obj = Me.Frame1.Controls.Add("forms.TextBox0")
With Obj
.Name = "TextBox" & i
.Object.Value = " "
.Left = PosX
.Top = 30 * ((i - 1) Mod 10) + 40
.Width = 100
.Height = 20
End With
Merci thev pour ton poste, mais ta proposition ne fonctionne pas.
Cette ligne créer une erreur si je laisse TextBox0
J'ai testé avec TextBox.1 plus d'erreur, mais les TextBox ne s'affichent plus.
Je continu à chercher de mon coté.
A vous lire, merci pour votre aide.
Cette ligne créer une erreur si je laisse TextBox0
Set Obj = Me.Frame1.Controls.Add("forms.TextBox0")
J'ai testé avec TextBox.1 plus d'erreur, mais les TextBox ne s'affichent plus.
Je continu à chercher de mon coté.
A vous lire, merci pour votre aide.