ListBoxRow.Selected
From Xojo Documentation
Read-Only Property (As Boolean )
Gets the selection status of the current row.
Notes
Selected is True if the row passed is selected. This property can be used to determine if the row is selected. For example,
Var rowsSelected As Integer
For Each row As ListBoxRow In ListBox.Rows
If row.Selected Then rowsSelected = rowsSelected + 1
Next
For Each row As ListBoxRow In ListBox.Rows
If row.Selected Then rowsSelected = rowsSelected + 1
Next
Examples
Getting the list of selected rows
If you allow the ListBox to have multiple items selected (see SelectionType), you may want to establish a list of all the rows selected. The following example shows how to achieve that. The ListBox is named ListBox1.