ListIndex Property (AListBox)

Returns or sets the index of the selected (caret) item.

Syntax

Object.ListIndex [ = lListIndex ]

The ListIndex property syntax has the following parts:

 

Name

Type

Description

Object

AListBox

AListBox 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. 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 returns the index of the currently selected item in the list of the AListBox:

llb1ListIndex = lb1.ListIndex

Applies to

AListBox

See Also

ItemData, List, ListCount