setScrollRange
setScrollRange(scrollBar: Integer; min: Integer; max: Integer; smallChg: Integer; largeChg: Integer);
The setScrollRange method enables control of the scroll ranges for Form, BaseControl, and Picture controls.
The setScrollRange method changes the scroll range data. Scroll range data has no impact unless the window also has a corresponding scroll bar.
TextBox controls can obtain the current scroll range but cannot set the current scroll range. This range is determined automatically by the amount of text data in the control. ListBox and Table controls also offer the getScrollRange method only, as the ranges are set automatically by the control.
The following table lists the scroll data that is available by using the setScrollRange method parameters.
Parameter | Description |
---|---|
scrollBar | 1 for horizontal, 2 for vertical |
min | Minimum scroll range |
max | Maximum scroll range |
smallChg | Size of scroll change when the user clicks a scroll arrow |
largeChg | Size of scroll change when the user clicks elevator or uses the Page keys |
All data units are in pixels.
For form and picture controls, the default scroll range data is listed in the following table.
Value | Default |
---|---|
min | 0 |
max | 1000 |
smallChg | 20 |
largeChg | 100 |
Control of the scroll bar position can be obtained by using the scrollHorzPos and scrollVertPos properties.
The code fragment in the following example shows the use of the setScrollRange method.
setScrollRange(ScrollBar_Vertical, 0, biggestOffset - (clientHeight/2).Integer, 20, 100);