ListIndex Property
Object List Next Object
Defined By: ComboBox
Description:
Returns the index number of the currently selected item in a list box type
control.
Settings:
For ComboBox the settings are:
Setting Description
-1 (Default) Indicates the user has typed new text in the combobox's text box
area.
n The index number of the currently selected list item.
For FileListBox the settings are:
Setting Description
-1 Indicates that no list item is currently selected.
n (Default) The index number of the currently selected list item.
Details:
An item can be selected by user action, such as clicking on it, or by the
program. If you assign a value to the ListIndex property, the current selection
changes to the entry specified by the index number.
When using ListIndex to select an item in code, be sure to use an index item
that corresponds to an item that exists in the current list. For example, if
there are ten items in the list, the valid index numbers are 0-9. Any other
numbers will cause a program exception to be thrown.
The expression List (List1.ListIndex) returns the string for the currently
selected item.
Data Type: Integer
See Also:
AddItem method, RemoveItem method, ListCount property, ListIndex property