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

# TCustomListView.OnSelectItem

Event handler signalled when the selected list item for the control is changed.

## Declaration

Source position: comctrls.pp line 1616

`protected property TCustomListView.OnSelectItem : TLVSelectItemEvent read FOnSelectItem write FOnSelectItem;`

## Description

OnSelectItem is signalled from the DoSelectItem method when a LVIS_SELECTED message is handled for the control. It occurs after the OnChange event handler has been executed (when assigned), and after the value in the Selected property has been updated. The Item parameter may be Nil when Selected has been cleared for the list view control, or the previously selected list item when OwnerData is enabled. The ASelected argument is True when the list item is selected.

## See also

TCustomListView.Change |  | Change - Internal procedure to simulate the OnChange event.
TCustomListView.OnChange |  | Event handler signalled when the content for a list item is changed.
TCustomListView.Selected |  | Contains the selected list item in the list view control.
TCustomListView.LastSelected |  | Contains the list item that was the most recently selected item on the control.
TLVSelectItemEvent |  | Specifies an event handler signalled when the selected state is changed for an item on a list view control.