link events to subs for controls created At Runtime

Posted on 2006-03-24
Medium Priority
Last Modified: 2010-04-23
Hello People

If I create a new control on my form during runtime, how can I set the new control's events?  For example, I create "btnNewButton1",  How can I add a "btnNewCutton1_Click" event? Keeping in mind, program is compiled and running!

Would it be possible to define a new class of buttons, and set it's _Click event so that a new control based on that new class would allready have it's _click event defined???  How would I do that??

Am I making sense???



Question by:pjlandry
1 Comment
LVL 96

Accepted Solution

Bob Learned earned 1000 total points
ID: 16286622
AddHandler btnNewButton1.Click, AddressOf btnNewButton1_Click


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question