ListBox.SelectedRowIndex
From Xojo Documentation
Property (As Integer )
aListBox.SelectedRowIndex = newIntegerValue
or
IntegerValue = aListBox.SelectedRowIndex
New in 2019r2
Supported for all project types and targets.
or
IntegerValue = aListBox.SelectedRowIndex
New in 2019r2
Supported for all project types and targets.
The number of the selected row.
Notes
If no item is selected, SelectedRowIndex returns ListBox.NoSelection. If the ListBox is in multiple-row selection mode, then the number of the lowest selected row is returned. For example, if rows 1, 3, and 4 are selected, SelectedRowIndex returns 1.
You can put the ListBox into multiple-row selection mode by changing the RowSelectionType property.
Sample Code
The following code in the Change event handler displays the text in the first column of the selected row:
The following code displays a message if no row is selected: