Link to home
Create AccountLog in
Avatar of dh-s
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("button12");).

Using Visual C# Express.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of crisco96
crisco96
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of dh-s
dh-s

ASKER

Thanks, they were all a great help!