Hi Kirk,
"Kirk Graves" <kr***********@yahoo.com> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
Sure. For instance, lets say you want to fire the click event for button2
from the click event for button1 you could do this:
-------------------------
private void button1_Click(object sender, System.EventArgs e)
{
button2_Click(this.button2,e);
}
------------------------
or, to be a little more honest, you could do this this way
------------------------
private void button1_Click(object sender, System.EventArgs e)
{
button2_Click(sender,e);
}
-----------------------
The above code is actually calling another method that may or may not
also be an event handler for button2's click event. If you actually wanted
to raise a given event for a control, you would call the appropriate
On[EventName] method. Of course the On[EventName] methods are protected,
which means you can only do this from the class itself or an inheriting
class. One exception to this rule happens to be the Button control, which
has a public PerformClick method (which does little more than call the
protected OnClick method).
Regards,
Dan