Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Events of "in runtime declared" Controls

  1. #1

    Thread Starter
    Addicted Member Genom's Avatar
    Join Date
    May 2006
    Posts
    186

    Resolved [RESOLVED] [2005] Events of "in runtime declared" Controls

    Hi;
    my application creates controls in runtime. It takes information from DB and with this information it creates x number of controls. All of these controls are the same. (lets say all of them are buttons). So I dont put any button on the form. The problem is that these buttons will do different things if they are being clicked. They need the infrmation, which is being saved in the text of buttons, and with this information they will do different things. The problem is that I cant define the evetn handler of a control which is being declared in the runtime. How can I do that?

    Thanks for every kind of help!
    (pls say if this message is not understandable)
    Dim Me As Coder

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    Toronto, ON
    Posts
    1,093

    Re: [2005] Events of "in runtime declared" Controls

    Just use the AddHandler:

    Code:
    dim btnNew as Button
    
    ...
    
    AddHandler btnNew.Click, AddressOf <function_name>
    That should do it

  3. #3

    Thread Starter
    Addicted Member Genom's Avatar
    Join Date
    May 2006
    Posts
    186

    Re: [2005] Events of "in runtime declared" Controls

    thanks Im tring
    Dim Me As Coder

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