Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
how to write a click event for a button which was created at run time

1 solution

if you know how to write an event handler:
each time you create a button datatype you can access the properties ;

for example take a look at this ;you can write this in form load:

Button b1 = new Button();
            b1.Click+=new EventHandler(b1_Click)//as you type += press tab twice so it creates what you want automatically!!  

sweet hah..? :-D :thumbsup:
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900