Can a button have two Click events?
I have a class that gets a reference of object Button and puts it in an inner variable. then with +=, I create a Click event handler for that button. inside the main form class, I created a Click handler for that button. what will occur when I click the button? will both handlers run?
Thanks


VulpesRank #55 · 29.2K reputationPosted Jun 8, 2011, 8:58 AM EDT
An event in C# can have multiple subscribers.
Praneeth KumarRank #4,422 · 344 reputationPosted Jun 8, 2011, 8:59 AM EDT
Roy S194 reputationPosted Jun 8, 2011, 9:00 AM EDT
So in your case both handlers should run. You can test it by putting breakpoints at the 2 handlers and see if they're being hit.