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

TCustomComboBox.ItemIndex

The index of the currently selected item, or -1 if none is selected.

Declaration

Source position: stdctrls.pp line 435

public property TCustomComboBox.ItemIndex : Integer
  read GetItemIndex
  write SetItemIndex
  default - 1;

Description

ItemIndex is an Integer property which contains the ordinal position in Items for the current list box selection in the control. The first value in Items is at index position 0 (zero). The final value in Items is at the index position ItemCount-1. When no value is selected in the list box, ItemIndex is set to -1. The default value for the property is -1.

When the value for the property is read, the widgetset class is queried when a handle has been assigned for the control.

Assigning a new value to the property causes the value in Text to be updated to reflect the new selection in the control. When ItemIndex is -1, Text is set to an empty string ('').

See also

TCustomComboBox.Items

  

The list of items displayed in the combo-box control.

TCustomComboBox.AddItem

  

Adds the specified string (and optional object) to the Items displayed in the control.

TCustomComboBox.Text

  

The value in the edit box for the control.

TCustomComboBox.AddHistoryItem

  

Add an item as the first entry in the history list for the control.


Version 3.2 Generated 2024-02-25 Home