ScrollBar

You can implement scrollbars with the ScrollBar control. The following code provides an example:

image

The implementation is simple, because you just have to provide the Minimum, Maximum, and current Value. The Scroll event is instead raised when the selector position changes. The event handler is then implemented as follows:

image

WPF offers a more versatile control, named ScrollViewer, as described in the next section.

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.