RefUserControlVB5



Dim PControl As Object
Dim MyControl As Control
Dim AControl As Object
'Get my UserControl

For Each AControl In ParentControls
If AControl.Name = Ambient.DisplayName Then
Set MyControl = AControl
Exit For
End If
Next
'Get the Form UserControl is on


Set PControl = ParentControls.Item(1).Parent
While Not (TypeOf PControl Is Form)
Set PControl = PControl.Parent
Wend

(refusercontrolvb5.html)- by Paolo Puglisi - Modifica del 25/3/2019