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
|
Function ControlItem( _
ByVal Str_NomControl As String _
) As Control
' Recherche du control
Return RechercherControl(Me, Str_NomControl)
End Function
Function RechercherControl( _
ByVal ctlParent As Control, _
ByVal Str_NomControl As String _
) As Control
Dim ctlEnfant As Control
Dim ctlRech As Control
' Recherche du control dans la liste de controls
For Each ctlEnfant In ctlParent.Controls
If ctlEnfant.Name = Str_NomControl Then Return ctlEnfant
If ctlEnfant.Controls.Count > 0 Then
ctlRech = RechercherControl(ctlEnfant, Str_NomControl)
If Not IsNothing(ctlRech) Then Return ctlRech
End If
Next
Return Nothing
End Function |
Partager