RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TComboBox.ItemIndex Property

Specifies the index of the selected item.

Pascal
property ItemIndex: Integer;
C++
__property int ItemIndex;

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.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!