Vcl.Controls.TCustomListControl.ItemIndex

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ItemIndex: Integer read GetItemIndex write SetItemIndex;

C++

__property int ItemIndex = {read=GetItemIndex, write=SetItemIndex, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TCustomListControl

Description

Specifies the index of the selected item.

Read ItemIndex to determine which item is selected. The first item in the list has index 0, the second item has index 1, and so on. If no item is selected, the value of ItemIndex is -1. If the list control supports multiple selected items, ItemIndex is the index of the selected item that has focus.

Set ItemIndex programmatically to select an item by passing in the index value.

Note: To implement the ItemIndex property in a TCustomListControl descendant, override the protected GetItemIndex and SetItemIndex methods.

See Also

Code Examples