+92 332 4229 857 99ProjectIdeas@Gmail.com

Form Mouse Move Event (C#.net)

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.


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();