SelectedIndex Property
Applies To
ListBox, ComboBox, Grid, TabControl, Wizard
Description
Gets or sets the SelectedIndex property returns an index of the currently selected item
Usage
GGet Form.Control.SelectedIndex, var
GSet Form.Control.SelectedIndex, value
- Form
- Name of a form or string variable containing a form name.
- Control
- Name of a control or string variable containing a control name. The control must exist in the specified form.
- var
- Integer variable that will contain the value of the property.
- value
- Integer expression for the new value of the property.
Values
Returns the index of the selected item, starting with 0. -1 is returned if no items are selected.
Remarks
Use SelectedIndex to determine which item the user has selected in a ListBox or ComboBox. Typically, you would do this in the Click event of the control.
See Also
AddItem Property , ComboBox Control , List Property , ListBox Control , Grid Control , Wizard Control
Example
Integer index
GGet frmMain.lstParts.SelectedIndex, index