How to Capture Mouse Movement in C#.NET

1 reply [Last post]
rocker
rocker's picture
User offline. Last seen 5 years 41 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 1 week 13 hours 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#

Who's online

There are currently 0 users and 3 guests online.

Recent Answers

Anonymous added a answer to LC3 Assembly Palindrome Program (3 years 23 weeks ago)
 
Anonymous added a answer to LC3 Assembly Palindrome Program (3 years 23 weeks ago)
 
Anonymous added a answer to Error-GetTypeHashCode()': no suitable method found to override (3 years 40 weeks ago)
 
Anonymous added a answer to AutoIncrement vs UniqueIdentifier (4 years 13 weeks ago)
 
vaibhav added a answer to Linq query on Datatable (4 years 15 weeks ago)
 
vaibhav added a answer to Delete Duplicate Records From a table (4 years 27 weeks ago)