ListIndex Property (AComboBox)

Returns or sets the index of the currently selected item in the object.

Syntax

Object.ListIndex [ = lListIndex ]

The ListIndex property syntax has the following parts:

 

Name

Type

Description

Object

AComboBox

AComboBox control

lListIndex

Long

A integer specifying the index of the currently selected item in the object.

Comments

The first index is zero. The default value is -1, which means nothing is selected. The number is read-only, at run time only. In a multiple selection, ListIndex returns the index of the item contained within the focus rectangle, whether or not that item is actually selected.

Example

The following statement shows how to obtain the index of the currently selected item in the list of the AComboBox:

lcb1ListIndex = cb1.ListIndex

Applies to

AComboBox

See Also

ItemData, List, ListCount