SCROLLBAR SET RANGE statement

Purpose | Manipulate a SCROLLBAR control. A ScrollBar is a control that allows the user to scroll a data object to bring into view portions of the object that extend beyond the borders of the window.

Syntax

SCROLLBAR GET PAGESIZE hDlg, id& TO datav&

SCROLLBAR GET POS hDlg, id& TO datav&

SCROLLBAR GET RANGE hDlg&, id& TO LoDatav&, HiDatav&

SCROLLBAR GET TRACKPOS hDlg, id& TO datav&

SCROLLBAR SET PAGESIZE hDlg, id&, pagesize&

SCROLLBAR SET POS hDlg, id&, position&

SCROLLBAR SET RANGE hDlg, id&, lolimit&, hilimit&

hDlg | Handle of the dialog that owns the ScrollBar.
id& | The control identifier assigned with CONTROL ADD SCROLLBAR.

Remarks

In each of the following samples and descriptions, the SCROLLBAR control that is the subject of the statement is identified by the handle of the dialog that owns the ScrollBar (hDlg), and the unique control identifier you gave it upon creation in CONTROL ADD SCROLLBAR. To alter the color of the bar or the background, use CONTROL SET COLOR.

SCROLLBAR GET PAGESIZE hDlg, id& TO datav&

The current page size of the ScrollBar is retrieved and assigned to the variable designated by datav&. Upon ScrollBar creation, the default page size is 10.

SCROLLBAR GET POS hDlg, id& TO datav&

The current position of the ScrollBar is retrieved and assigned to the variable designated by datav&. Upon ScrollBar creation, the default position is 0.

SCROLLBAR GET RANGE hDlg, id& TO LoDatav&, HiDatav&

The current range of the ScrollBar is retrieved and assigned to the variables designated by LoDatav& and HiDatav&. Upon ScrollBar creation, the default ScrollBar range is 0 to 100.

SCROLLBAR GET TRACKPOS hDlg, id& TO datav&

The current position of the scroll box, being dragged by the user, is retrieved and assigned to the variable designated by datav&. This is normally read while responding to the %SB_THUMBPOSITION or the %SB_THUMBTRACK messages. The TRACKPOS is then used to move the scroll position with SCROLLBAR SET POS.

SCROLLBAR SET PAGESIZE hDlg, id&, pagesize&

The current page size of the ScrollBar is set to the value of the parameter pagesize&, and the bar is redrawn to reflect the new position.

SCROLLBAR SET POS hDlg, id&, position&

The current position of the ScrollBar is set to the value of the parameter position&, and the bar is redrawn to reflect the new position.

SCROLLBAR SET RANGE hDlg, id&, lolimit&, hilimit&

The range for the ScrollBar is specified to be from lolimit& to hilimit&. If lolimit& is greater than hilimit&, the results are undefined.

See also | Dynamic Dialog Tools, CONTROL ADD SCROLLBAR, CONTROL SET COLOR