Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C Sharp form constant updating?

Through Visual Studio you can easily create a method for an event (button click, etc). Is there a way to create a method for multiple events, like a method that would run any time one of three buttons were clicked, or one of many textboxes were typed in?

like image 856
Wilson Avatar asked May 26 '26 01:05

Wilson


1 Answers

Once you've created the method once you should be able to use it for any other event that has a similar signature.

From the Designer, don't double-click the method but instead drop down the list for any existing event handler that can be assigned to your chosen event.

Like @lcfseth notes, you can identify which particular control sent the message via the object sender argument.

like image 126
Austin Salonen Avatar answered May 27 '26 15:05

Austin Salonen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!