Ok, I knew there was an easier (less code) way to do this...
Basically create your handler function like so:
private void ButtonHandler(object sender, System.EventArgs e) {
MessageBox.Show(sender.ToString());
}
Then, For each button you can select the Events in the Properties box and
change the Click event to point to your ButtonHandler function.
---
John Wiese
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"John Wiese [MS]" <jw****@online.microsoft.com> wrote in message
news:#e**************@TK2MSFTNGP11.phx.gbl...
Jakub,
You could write your own function that takes the same parameter (sender,
e) as the btn_click funcitons, then in your btn_click simply call your
function passing along the input parameters you got. This would allow your handler
function to use sender.ToString() to determine which button was clicked.
John Wiese
--
This posting is provided "AS IS" with no warranties, and confers no
rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jakub Otahal" <jo*****@ftvs.cuni.cz> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl... Hi all,
I have problem........ I have array of buttons and I want to call one
common event service. But I need to know the index of clicked button --
how can I do that?
thanks
jakub