Fire up a click event inside a control

  • Thread starter Thread starter Tao
  • Start date Start date
T

Tao

hi.. group

I have a user control A. How can I manually fire up an event (e.g.
MouseClick) in A.

That is the code looks like:

class A : UserControl
{
private void Fireup()
{
//fire up an mouse click event.
}
}

thanks
 
To invoke an event from a subclass, the general convention is a
protected OnEventName(...) method; in this case, you can simulate a
mouse-click by calling OnMouseClick(EventArgs.Empty);

Marc
 
Oops; previous post should have used either MouseEventArgs.Empty or
something like new MouseEventArgs( MouseButtons.Right, 1, xPos, yPos,
0)

Marc
 
Back
Top