JonGartzia
asked on
UserControl problem
Hello everybody,
I'm inside a UserControl. I want to pass this UserControl object from my UserControl to a
function located outside this UserControl object. How can I get it so I can later access some
UserControl's functions?
Thanks in advance
I'm inside a UserControl. I want to pass this UserControl object from my UserControl to a
function located outside this UserControl object. How can I get it so I can later access some
UserControl's functions?
Thanks in advance
Sorry but I don't understand ... can you post an example?
Have you tried:
Private Sub UserControl_SomeEvent()
Call ExternalRoutine(Me)
End Sub
Public Sub ExternalRoutine(ByRef ctl As UserControl)
'YOUR CODE
End Sub
Failing that, you could always try using:
Public myUserControl As UserControl
in your Declarations section...
HTH
J.
Private Sub UserControl_SomeEvent()
Call ExternalRoutine(Me)
End Sub
Public Sub ExternalRoutine(ByRef ctl As UserControl)
'YOUR CODE
End Sub
Failing that, you could always try using:
Public myUserControl As UserControl
in your Declarations section...
HTH
J.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank EddyKT. Seems to work.