cursor coordinates

PhilH

Member
Joined
Aug 22, 2003
Messages
18
I have a text box that displays the cursor coordinates for the form mousemove event:
Code:
 Textbox1.Text = (Cursor.Position.X & " " & Cursor.Position.Y)

The form occupies the whole screen area. The screen width is 1024 pixels but I notice that if the mouse is moved very quickly off the edge of the form then the textbox display doesnt keep up. For example the last x value displayed can be as low as 900 depending on how fast I move the mouse sideways.
Can someone explain why this should happen??
 
Your system just isnt fast enough to keep up with the pointer. Moving the mouse pointer very fast always has the result that it jumps in intervals of more than one pixel, theres not much you can do about it.

You could capture the MouseLeave event of your form, get the mouse coordinates _then_ interpolate between them and the last set of recorded coordinates I suppose.
 
to get around this problem add a Timer to your form and enable it - set the interval to whatever you want (~300ms should be okay) and update the display of the Mouse position in the Timers Tick-Event! this way youve always the current position of the mouse...
 
Back
Top