April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to create a scrollable picture.
Solution
Leverage the automatic scroll capabilities of the System.Windows.Forms.Panel control by setting Panel.AutoScroll to True and placing a System.Windows.Forms.PictureBox control with the image content inside the Panel.
How It Works
The Panel control has built-in scrolling support, as shown in recipe 10-1. If you place any controls in it that extend beyond its bounds and you set Panel.AutoScroll to True, the panel will show scroll bars that allow the user to move through the content. This works particularly well with large images. You can load or create the image in memory, assign it to a picture box (which has no intrinsic support for scrolling), and then ...
Read now
Unlock full access