SCROLLBAR Statement

Summary: Syntax

SCROLLBAR id, x, y, width, height[[,style]]

This statement defines a scroll-bar control belonging to the SCROLLBAR class. It is a rectangle that contains a scroll thumb and has direction arrows at both ends. The scroll-bar control sends a notification message to its parent whenever the user clicks the mouse in the control. The parent is responsible for updating the thumb position. Scroll-bar controls can be positioned anywhere in a window and used whenever needed to provide scrolling input.

The id field takes a unique integer value that identifies the control.

The x and y fields take integer values that specify the location of the upper-left corner of the control in dialog units relative to the origin of the dialog box. The horizontal units are 1/4 of the dialog base width unit; the vertical units are 1/8 of the dialog base height unit. The current dialog base units are computed from the height and width of the current system font. The GetDialogBaseUnits function returns the dialog base units in pixels.

The width and height fields take integer values that specify the width and height of the control. The width units are 1/4 of the dialog base width unit; the height units are 1/8 of the dialog base height unit.

The optional style field can contain any combination (or none) of the following styles:

WS_TABSTOP

WS_GROUP

WS_DISABLED

These styles are described in the list of window styles following the description of the STYLE statement on page 171.

In addition to these styles, the style field may contain any combination (or none) of the SCROLLBAR-class styles described in the list of control styles on page 195. Styles can be combined using the bitwise inclusive OR operator.

Summary: Comments

The x, y, width, and height fields can use the addition operator (+) for relative positioning. For example, 15 + 6 can be used for the x field.

The default style for SCROLLBAR is SBS_HORZ.

The following example demonstrates the correct usage of the SCROLLBAR statement:

SCROLLBAR 999, 25, 30, 10, 100