ListIndex Property

Sets or returns the currently selected item in the drop down list. Not available at design-time, run-time only.

object.ListIndex = [integer]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and integer is the index of the currently selected item in the list array.

Client support

   Newlook Smartclient only.

Use

The ListIndex property is useful for determining the index of the currently selected item. This index can then be used to reference the corresponding ItemData and List array values.

If no item is selected in the list, then this property returns –1.

This property can also be set at runtime. Setting this property does not remove the Text value from the list, it only changes the currently selected item, and hence the value that displays in the text area of the control.

See Also

ItemData property | List property (ComboBox) | List property (ListBox) | ListCount property | NewIndex property | TopIndex property

Applies To

Combo box control

List box control