public class myMouseEventClass
{
protected Label label1;
// Function signatures must match the signature of the
// MouseEventHandler class.
public void myMouseDown(object sender, MouseEventArgs ex)
{
if (ex.Button == MouseButtons.Left)
{
// Insert code to execute when a mouse down event is
// received and the left button was clicked.
}
}
// A method that will show you where you are in the control
// that is receiving the event.
public void myWhereAreWe(object sender, MouseEventArgs ex)
{
label1.Text = "We are at X: " + ex.X + " Y: " + ex.Y ;
}
}
////copy from .NET Framwork SDK