Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

How do I pan a picturebox???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul L - 26 Oct 2004 18:34 GMT
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.
Justin Rogers - 27 Oct 2004 01:07 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.