How to Capture Mouse Movement in C#.NET

1 reply [Last post]
rocker
rocker's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 11/19/2009

How to Capture / Handle Mouse Movement in c#.NET form.

vaibhav
vaibhav's picture
User offline. Last seen 4 weeks 6 days ago. Offline
Joined: 08/19/2009
Here is the code. public

Here is the code.

public Form1( ) 
{ 
    InitializeComponent(); 
 
    this.MouseMove += new MouseEventHandler(Form1_MouseMove); 
} 
 
void Form1_MouseMove(object sender , MouseEventArgs e) 
{ 
    label1.Text= e.Location; 
} 

 

Also take a look at following links.

  1. Mouse and Keyboard library

  2. Handling Mouse Events in C#