PhilH Posted September 26, 2003 Posted September 26, 2003 I have a text box that displays the cursor coordinates for the form mousemove event: 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 doesn't 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?? Quote
*Gurus* divil Posted September 26, 2003 *Gurus* Posted September 26, 2003 Your system just isn't 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, there's 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Hamburger1984 Posted September 26, 2003 Posted September 26, 2003 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 Timer's Tick-Event! this way you've always the current position of the mouse... Quote
PhilH Posted September 27, 2003 Author Posted September 27, 2003 Thanks for the info. I'll try your suggestions and work around the problem. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.