"Avi G" <Av**@discussions.microsoft.com> a écrit dans le message de news:
5F**********************************@microsoft.com...
| i use VS 2005 and i have a form with 2 buttons on it, my question is how i
| can link to button 2 what button 1 do without put the hole code that
button 1
| do to button 2?
Simply write the code in a method that satisies the pattern of a button
event handler and link the Click event of both buttons to that method.
private void CommonCode(object sender, EventArgs e)
{
// do something
}
Having declared this method, you should find that the event selector for the
Click event will show it as an option for both buttons. Just drop down the
combobox in the property editor instead of double-clicking on the button.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer