Knowing what buttons was clicked in a particulat function in C#
Posted on 2008-06-16
I have a single function that will do a similar thing many times, but I need it to depend on the particular button that was pressed. I have 16 buttons, and their click event all goes to this single function. Is there a way for the function to know what button was pressed, and information about the button such as (most importantly) the text that is displayed.
I want to avoid having a function for each button that then calls the function that I want specifying what button is called (for example, theStandardFunction("button12");).
Using Visual C# Express.