1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Dim lvwCtrl as MSComctlLib.ListViewCtrl
Public Sub CreatDynamicFormControl(ParentForm As UserForm, _
bStrProgrID As ListView, _
ListViewName As String, _
IsControlVisible As Boolean, _
ParamArray ListColHeaders() As Variant)
On Error GoTo ErrHnd
Set lvwCtrl = ParentForm.Controls.Add("MSComctlLib.ListViewCtrl", ListViewName, IsControlVisible)
With lvwCtrl
'Propriétés du Contrôle...
End With
Exit Sub
ErrHnd:
MsgBox "Une Erreur d'exécution est survenue dans la procédure de contruction du control ListView (" & _
Err.Description & ")", 16 + 0, "Echec construction Object ListView"
If (Not lvwCtrl Is Nothing) Then Set lvwCtrl = Nothing
End Sub |
Partager