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

# TCustomComboBox.OnSelect

Handler invoked when an item is selected.

## Declaration

Source position: stdctrls.pp line 404

`protected property TCustomComboBox.OnSelect : TNotifyEvent read FOnSelect write FOnSelect;`

## Description

OnSelect is a TNotifyEvent property with the event handler signalled when an item is selected in the list box for the control.

OnSelect is signalled (when assigned) from the Select method when ItemIndex contains a positive non-zero value. Select (and subsequently OnSelect) are called from multiple methods in TCustomComboBox. SelectItem calls Select when the value in ItemIndex is changed as a result of assigning a value to Text. KeyUp calls Select when the value in Text is updated by auto-completion features in the control. Select is also called when the LM_SelChange message is handled for the control.

Implement and assign an object procedure to the handler to respond to the event notification.

## See also

TCustomComboBox.Select |  | Signals the OnSelect event handler when ItemIndex is changed.
TCustomComboBox.SelectItem |  | Selects the list item with the specified text.
TCustomComboBox.ItemIndex |  | The index of the currently selected item, or -1 if no item is selected.
TCustomComboBox.Items |  | The list of items displayed in the combo-box control.
TCustomComboBox.KeyUp |  | Handles AutoComplete and AutoSelect for the control.
TNotifyEvent