Results 1 to 2 of 2

Thread: Event Handler for dynamically created Buttons

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2009
    Location
    sydney
    Posts
    265

    Event Handler for dynamically created Buttons

    How to add an click event handler for multiple dynamically created buttons ?
    Thanks in advance

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Event Handler for dynamically created Buttons

    You write a method just as you always do to handle an event, but without the Handles clause. If you're not sure about the method signature, add a Button in the designer, let the IDE create the method and then delete the Button. You then use the AddHandler statement to attach the method to the event. The MSDN documentation for the AddHandler statement will have more information and an example.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

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