Link to home
Start Free TrialLog in
Avatar of JonGartzia
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
Avatar of mmusante
mmusante

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.
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JonGartzia

ASKER

Thank EddyKT. Seems to work.