Results 1 to 2 of 2

Thread: Add usercontrol to collection

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    58

    Add usercontrol to collection

    How can i add my usercontrol to a global collection?

    Code:
    'In module
    
    public function addMe(obj as usercontrol1)
         coll.add(obj)
    end function 
    
    'In usercontrol
    Private Sub UserControl_Initialize()
          addMe(this)     
    End Sub
    However, i cant figure out how to get a reference to the control..any1 can help me out?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Add usercontrol to collection

    The user control object's name is UserControl, so I'm guessing (without trying it out) that it would be
    Code:
    Private Sub UserControl_Initialize()
          addMe(UserControl)     
    End Sub
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width