Jump to content


Check out our Community Blogs

Barnsite's Blog



Assign Event to Multiple Controls, Windows forms and C#

  Posted by Barnsite, 26 November 2012 - - - - - - · 1098 views
programming
Lets say that you want the same event to be triggered by multiple controls. You don’t want to have to rewrite the code for all the controls.
Here we’re going to use four buttons with one shared event that shows the name of the button that’s been clicked.
Firstly create a form (in this case Form1) and add four buttons (button1, button2,...






My Picture

1 user(s) viewing

0 members, 1 guests, 0 anonymous users

Categories

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download