dh-s
asked on
Knowing what buttons was clicked in a particulat function in C#
Hello,
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("butto n12");).
Using Visual C# Express.
Thanks.
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("butto
Using Visual C# Express.
Thanks.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER