Discussion Locked

Scroll a Picturebox

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have read that scrolling a picture box isn't too difficult, but I can't figure it out. Can someone please point me in the right direction?

4 replies

by gbworld

Here is one I saved in my own personal help file:

Q. How do I scroll a picturebox? A. There are several ways to accomplish what you wish. The two most common are the following: You can use the PictureBox.Print method toupdate the picture box inresponse to the user moving the scrollbar. This method is simple but limited. It works well enough for scrolling text. You can use a _pair_ of pictureboxes, the second or "inner" of which is actually much larger than the "outer" box which acts as akind of window for viewing part of the larger box. This method is handy for displaying graphics that the user will browse. If the inner picture box is large, a lot of memory will be sacrified and the picture or text may be slow to load. Again, yourcode will scroll the inner box in response to the user moving the scrollbar. If you have not used scrollbars before, take a look at Scroll Bars in the on-line help. Pay attention to the Scroll and Change events. You will use one of those for your code. (29-Jul-98 Bob Walsh rlwalsh@capecod.net)

I believe this was from vbexplorer.com. Another good site to look at for code samples is vbcode.com and vbxml.com if you want VB and XML.

Gregory A. Beamer
MCP: +I, SE, SD, DBA

by devry student

Okay, this told me that it was possible, but didn't offer any tips as to how to get it done. Thanks for trying, but I figured it out after a while.

by devry student

I found that answer as well, but couldn't figure out how to use the PictureBox.Print method... is there a code snippet(example) to help figure out how to use this?

This discussion is closed to new replies.