Chris wrote:
Is this the correct code to have one button execute the code of anothe rbutton?
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
printToolStripMenuItem.Click += new EventHandler(
buttonLoad_Click);
}
That code would add an event handler every time you click the button.
That means that the first time you click the button, the method is not
called, the second time you click the button the method is called once,
the thrird time you click the button the method is called twice, and so on.
Just change the Click property of the button to use the buttonLoad_Click
method instead of the printToolStripMenuItem_Click method.
Perhaps also you should change the name of the method to reflect what it
actually does instead of buttonLoad_Click, as it no longer only handles
that event.
--
Göran Andersson
_____
http://www.guffa.com