Click here to Skip to main content
15,886,554 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a windows form and trying to calculate something when the user moves the cursor. Is there an event handler on changing the cursor position.
Posted
Comments
Sandeep Mewara 15-Jan-13 13:28pm    
Will not cursor position help in your something?
http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position%28v=vs.100%29.aspx
Jason Gleim 15-Jan-13 14:56pm    
Just a word of warning... you should hook and unhook those events as-needed. Obviously, MouseMove generates a crap-load of events so you should only hook your event handler just before you need the data and then unhook it when you are done. And you should keep your event handler short and sweet. If your handler takes longer to execute than it takes for the next event to arrive, you can fill the event queue and bog down your app and/or start dumping events.

Processing events is one thing, processing events that generate hundreds or thousands of interrupts per second is a whole different beast.
Sergey Alexandrovich Kryukov 15-Jan-13 15:38pm    
Mouse cursor or caret? In your application or outside?
—SA
missak boyajian 16-Jan-13 10:01am    
I already found a solution. I used Timer in winform controls and I am able to do what I needed. But thanks for the replies.

There is: Control.OnMouseMove[^]
 
Share this answer
 
Hi,

Use Hooks:
Global System Hooks in .NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900