DesktopListBox.RowSelectedAt
From Xojo Documentation
Property (As Boolean )
aDesktopListBox.RowSelectedAt(row as Integer) = newBooleanValue
or
BooleanValue = aDesktopListBox.RowSelectedAt(row as Integer)
New in 2021r3
Supported for all project types and targets.
or
BooleanValue = aDesktopListBox.RowSelectedAt(row as Integer)
New in 2021r3
Supported for all project types and targets.
Gets or sets the selection status of the passed Row.
Notes
Selected is True if the row passed is selected. This property can be used to determine if the row is selected and to select the row. For example,
Listbox1.RowSelectedAt(1) = True //selects the second item in the first column.
Examples
Select Multiple Rows
In order to select multiple row, the RowSelectionType must be set to Multiple. This code selects only the even-numbered rows:
ListBox1.ListIndex = DesktopListBox.NoSelection // Deselect all rows
For i As Integer = 0 To ListBox1.LastRowIndex
If i Mod 2 = 0 Then
ListBox1.RowSelectedAt(i) = True
End If
Next
For i As Integer = 0 To ListBox1.LastRowIndex
If i Mod 2 = 0 Then
ListBox1.RowSelectedAt(i) = True
End If
Next
Getting the list of selected rows
If you allow the DesktopListBox to have multiple items selected (see RowSelectionType), you may want to establish a list of all the rows selected. The following example shows how to achieve that. The DesktopListBox is named ListBox1.