Listbox selected value

Hello,
I have a listbox with the possibility to select multiple rows. How can I get/read the values of the selected rows?

Var selectedRows() As Integer // Will hold the index of each selected row

For row As Integer = 0 To ListBox1.LastRowIndex
If ListBox1.Selected(row) Then
selectedRows.AddRow(row) // This row is selected
End If
Next

Thanks.
This works. But how can I get the value/content of the selected row?

arg = ListBox1.SelectedRowValue

With this I get only the vaue of first row.

https://docs.xojo.com/ListBox.CellValueAt

Set column to 0 and row to the row index to mimmic SelectedRowValue

Thanks. It’s working now :slight_smile:

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.