• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

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
0
JonGartzia
Asked:
JonGartzia
1 Solution
 
mmusanteCommented:
Sorry but I don't understand ... can you post an example?
0
 
jimbobmcgeeCommented:
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.
0
 
JonGartziaAuthor Commented:
Thank EddyKT. Seems to work.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now