Form Mouse Move Event:
The following code shows you form mouse move event, you move your mouse in form boundary and it shows you the movement of mouse pointer and diplays the x-axis and y-axis in label.
Code
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
int x = e.X;
int y = e.Y;
label1.Text = "X-Axis Position:" + x.ToString() + "Y-Axis Position:" + y.ToString();
}
0 comments:
Post a Comment