Hi Fanor,
If your control derives from either UserControl or Control you can call
the protected OnClick method from within your control's definition:
this.OnClick(EventArgs.Empty);
or, in the case you need to make this method public to consumers of
your control you can expose a public interface to the protected
"OnClick" method (the Button control already does this):
public void PerformClick()
{
this.OnClick(EventArgs.Empty);
}
Additionally, you can override the OnClick method in your derived
control's implementation (so your control can process other things
before raising the "Click" event).
protected override void OnClick(EventArgs e)
{
//do something here before calling the base OnClick() method to
raise the click event.
base.OnClick (e);
}
-GM
http://nonspect.com