SCROLLBAR

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

The SCROLLBAR statement creates a scroll-bar control. The control is a rectangle that contains a scroll box 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 scroll-box position. Scroll-bar controls can be positioned anywhere in a window and used whenever needed to provide scrolling input.

Parameters

id

Identifies the control. This parameter takes a unique integer value.

x

Specifies the x-coordinate 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.

y

Specifies the y-coordinate of the upper-left corner of the control in dialog units relative to the origin of the dialog box. The vertical units are 1/8 of the dialog base height unit.

width

Specifies the width of the control. The width units are 1/4 of the dialog base width unit.

height

Specifies the height of the control. The height units are 1/8 of the dialog base height unit.

style

Specifies a combination (or none) of the following styles: WS_TABSTOP, WS_GROUP, and WS_DISABLED.

In addition to these styles, the style parameter may contain a combination (or none) of the SCROLLBAR-class styles. Styles can be combined by using the bitwise OR operator.

Comments

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

The default style for SCROLLBAR is SBS_HORZ.

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.

Examples

The following example demonstrates the usage of the SCROLLBAR statement:

SCROLLBAR 999, 25, 30, 10, 100