it will exercise two ways to cause one event handler to handle two (or more) events.
You need to know which button is pressed? Check the sender object's name property. Here's a WinForms example of (button click) event handler that checks which button is pressed
private void buttonClick(object sender, EventArgs e)
{
if (((Button)sender).Name == "button1")
{
MessageBox.Show("button1 Pressed");
}
if (((Button)sender).Name == "button2")
{
MessageBox.Show("button2 Pressed");
}
}
Your code will be similar but the button names are "btnOK" and "btnDoIt".
HTH
Teme64
Veteran Poster
1,031 posts since Aug 2008
Reputation Points: 218
Solved Threads: 203