[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomScrollBar.SetParams

Updates the Min and Max values, the size of the page, and the position in the scrollbar.

## Declaration

Source position: stdctrls.pp line 102

`public procedure TCustomScrollBar.SetParams(`
`APosition: Integer;`
`AMin: Integer;`
`AMax: Integer;`
`APageSize: Integer`
`); procedure TCustomScrollBar.SetParams(`
`APosition: Integer;`
`AMin: Integer;`
`AMax: Integer`
`);`

## Arguments

`APosition` |  | Value applied to the scrollbar position.
`AMin` |  | Value applied to the scrollbar minimum value.
`AMax` |  | Value applied to the scrollbar maximum value.
`APageSize` |  | Value applied to the scrollbar page size.

## Arguments

`APosition` |  | Value applied to the scrollbar position.
`AMin` |  | Value applied to the scrollbar minimum value.
`AMax` |  | Value applied to the scrollbar maximum value.

## Description

SetParams is an overloaded procedure used to update the values in the TScrollInfo structure passed to the widgetset class. Values passed in parameters are stored in the TScrollInfo instance, and used to validate the new settings for the scrollbar.

SetParams raises an EInvalidOperation exception if the value in AMax is smaller than the value in AMin.

The value in APosition is normalized to ensure that it is in the range specified by AMin and AMax.

APageSize is set to 0 (zero) if it contains a negative value.

When any of the parameter values differ from the current values in the class instance, the class instance is updated. SetScrollInfo is called to apply the changed values when a handle has been allocated for the control. SetScrollPos is called when APosition contains a value different than the one in the class instance. The Change method is called to process the updated values in the control and signal the OnChange event handler (when assigned). The SetParams method in the widgetset class is called to synchronize the changes.

SetParams is called when a new value is assigned to the Position, Min, Max, or PageSize property.

## See also

TCustomScrollBar.Position |  | The position of the slider in the scrollbar.
TCustomScrollBar.Min |  | The minimum value for the top or left position depending on orientation.
TCustomScrollBar.Max |  | The maximum value for the bottom or right position depending on orientation.
TCustomScrollBar.PageSize |  | The size of the slider relative to the total scroll range.
TCustomScrollBar.Change |  | Invokes the OnChange event handler for the control.
TCustomScrollBar.OnChange |  | Event handler signalled when the value in Position, Min, Max, or PageSize is changed.
TScrollInfo