vbpslogo2.gif (19593 bytes)
Brad's VB-32 Programs & Samples

Posted: 04/12/00, last update: 04/12/00

Home

ScrollView: A UserControl becomes a natural scrollable viewport

Demonstrates how to turn a UserControl into a real scrollable viewport. Once the size of the view in the UserControl is established, scrollbars are added to it by setting its WS_H/VSCROLL window styles. When corresponding WM_H/VSCROLL messages are received, the control's window origin and DC are offset with the OffsetWindowOrgEx and ScrollWindowEx APIs respectively, allowing both graphics and child contained controls to be scrolled seamlessly within the UserControl's window.

Download scrollview.zip (13kb)