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

# TSelectionChangeEvent

Specifies an event handler for change notifications from a list box control.

## Declaration

Source position: stdctrls.pp line 529

`type TSelectionChangeEvent = procedure(`
`Sender: TObject;`
`User: Boolean`
`) of object;`

## Arguments

`Sender` |  | The list box control for the notification.
`User` |  | True on entry if the change was caused by user interaction with the control. False if the selection was changed in program code, like setting the selected item index for the list box control.

## Description

TSelectionChangeEvent is an object procedure type which specifies an event handler signalled when a selection is changed for a list box control. Arguments passed to the handler identify the list box control, and the origin for the change notification.

The User argument is True when the action performed includes one of the following:

- An alpha-numeric key is pressed.
- A cursor navigation key is pressed.
- The Home, End, Page Up, or Page Down key is pressed.

TSelectionChangeEvent is the type used to implement the OnSelectionChange property in TCustomListBox. The application must implement and assign an object procedure using the signature for the handler to respond to the event notification.