Returns or sets the index of the selected (caret) item.
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. |
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.
The following statement returns the index of the currently selected item in the list of the AListBox:
llb1ListIndex = lb1.ListIndex