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

# TCustomScrollBar.OnScroll

Event handler signalled when scrollbar messages are applied.

## Declaration

Source position: stdctrls.pp line 114

`public property TCustomScrollBar.OnScroll : TScrollEvent read FOnScroll write FOnScroll;`

## Description

OnScroll is a TScrollEvent property which provides an event handler signalled when the position for the scrollbar has been changed.

Sender contains the scrollbar for the event.

ScrollCode contains the scroll command constant for the operation.

ScrollPos contains the new position for the scrollbar when the operation is completed. The event handler can be used to override the value in ScrollPos before it is applied to the Position property in the class instance.

OnScroll is signalled (when assigned) from the Scroll method, and occurs when control messages, like CNHScroll and CNVScroll, are processed and applied.

Use the OnChange event to respond to programmatic changes to property values in the scrollbar.

## See also

TCustomScrollBar.Position |  | The position of the slider in the scrollbar.
TCustomScrollBar.Scroll |  | Signals the OnScroll event handler.
TCustomScrollBar.OnChange |  | Event handler signalled when the value in Position, Min, Max, or PageSize is changed.
TScrollEvent |  | Defines an event handler type for scrollbar events.