Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
François Picalausa
Bonjour/soir,
Essaye ceci: Dim a As VBComponent, MyForm As VBForm, MyControl As VBControl
Set a = VBInstance.ActiveVBProject.VBComponents(1) If a.Type = vbext_ct_VBForm Then Set MyForm = a.Designer Set MyControl = MyForm.VBControls.Add("VB.Label") MyControl.Properties("Caption") = "Hello!" End If
"Sebastien" a écrit dans le message de news:3fa8e0fc$0$242$
Bonjours,
Est ce que qq connais le code pour ajouter des composant dans une form a la voler, dans un addin?
j'aitrouver la collection VBControls mais imposible de la lier a une form...
a++ Sébastien
Bonjour/soir,
Essaye ceci:
Dim a As VBComponent, MyForm As VBForm, MyControl As VBControl
Set a = VBInstance.ActiveVBProject.VBComponents(1)
If a.Type = vbext_ct_VBForm Then
Set MyForm = a.Designer
Set MyControl = MyForm.VBControls.Add("VB.Label")
MyControl.Properties("Caption") = "Hello!"
End If
Essaye ceci: Dim a As VBComponent, MyForm As VBForm, MyControl As VBControl
Set a = VBInstance.ActiveVBProject.VBComponents(1) If a.Type = vbext_ct_VBForm Then Set MyForm = a.Designer Set MyControl = MyForm.VBControls.Add("VB.Label") MyControl.Properties("Caption") = "Hello!" End If