Je voulais remercier francois Picalausa pour sont code
'---------------------------------------------------------------------------
----------------
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
'---------------------------------------------------------------------------
----------------
sa marche bien , mais apprement il ne me permet pas d'ajouter de listview
...
---------------- 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
----------------
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
---------------- 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