I have an array of buttons and a method suits for all buttons. But, how can I know which button in the array was clicked? ([0,0] \ [0,1] ...)
Can I pass information to the method?
Thanks.
I have an array of buttons and a method suits for all buttons. But, how can I know which button in the array was clicked? ([0,0] \ [0,1] ...)
Can I pass information to the method?
Thanks.
gavra.
The Click event passes the sender (button):
Code:void Button1_Click(object Sender, System.EventArgs EventArgument) { var Button = Sender as System.Windows.Forms.Button; //Store extra data in Button.Tag if neccessary }
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.