max

Type: Integer

Availability: Read or write at any time

The max property of the ScrollBar control contains a scroll bar position maximum value property setting when the scroll box is in its lowest position (the vertical scroll bar control) or farthest right position (horizontal scroll bar control). You can specify any valid integer. The default setting is 32,767.

The Windows environment automatically sets ranges for scroll bars proportional to the contents of forms, combo boxes, and list boxes. For a horizontal scroll bar control, however, you must specify these ranges.

Use the max property to set a range appropriate to how the scroll bar control is used; for example, as an input device or as an indicator of speed or quantity. Typically, you set the max property in the JADE development environment. You can also set it in logic at run time, if the scrolling range must change dynamically.

The code fragment in the following example shows the use of the max property.

app.myCompany.allProducts.copy(theArray);
listBoxScrollBar.min         := 1;
listBoxScrollBar.value       := 1;
listBoxScrollBar.max         := theArray.size - listBoxRight.lines - 1;
listBoxScrollBar.largeChange := (theArray.size/20).Integer;

Use the largeChange property to set the maximum scrolling increments for a scroll bar control.

If the max property is set to a value less than the value of the min property, the value of the max property is then set at the farthest left or highest position of a horizontal or vertical scroll bar, respectively.