I've created a picturebox inside a panel control with autoscroll enabled.
The picturebox is twice the size of the panel so scrollbars are always
shown. What I would like to do, is when the user presses the left mouse
button and moves the mouse, the mouse cursor stays frozen on screen, but the
image within the picturebox is panned around (the image is not technically
moving, but the location of the picturebox via the autoscrollposition
property).
Does anyone know how to do this? How do you keep the mouse cursor frozen
too?
Thanks in advance for any feedback.
Paul L.
Technically you can't freeze the location of the mouse since some movement is
required
to register deltas. What you can do is reset the position of the mouse back to
it's original
location after you've examined the deltas and moved your picture box
accordingly.
Similar techniques are used in video games where every now and then you'll see
the problem
of a mouse cursor actually rendering, but constantly getting reset back to the
*origin* in the
center of the screen.

Signature
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
> I've created a picturebox inside a panel control with autoscroll enabled.
> The picturebox is twice the size of the panel so scrollbars are always
[quoted text clipped - 10 lines]
>
> Paul L.
Paul L - 27 Oct 2004 14:50 GMT
How do you reset the mouse position when the MouseEventArgs X and Y
properties are read-only?
Paul
> Technically you can't freeze the location of the mouse since some movement is
> required
[quoted text clipped - 23 lines]
> >
> > Paul L.
Justin Rogers - 27 Oct 2004 16:06 GMT
Cursor.Position?

Signature
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
> How do you reset the mouse position when the MouseEventArgs X and Y
> properties are read-only?
[quoted text clipped - 35 lines]
>> >
>> > Paul L.
Paul L - 27 Oct 2004 17:31 GMT
Doh!
Paul
> Cursor.Position?
>
[quoted text clipped - 37 lines]
> >> >
> >> > Paul L.