In VB.NET I can do
private sub button_click(sender, e) handles Button1.Click, Button2.Click etc... do something... end sub
Is there a method for this in C# .NET? I have roughly 16 buttons that all call the same function, just passing the text of the button to the function. I would rather not have 16 private void button_clicks
calling one function.
I am not sure how to do this though (not familiar with C# to much.)
Button1.Click += button_click;
Button2.Click += button_click;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With