I found this bit of code on the forums a few weeks ago from @MarkusR i believe? (Cant find the post)
It loops through a listbox and highlights the row that matches the text in the textfield.
Textfield (TextChanged) event:
Pressed()
if TextField1.text = "" then
Listbox1.SelectedRowIndex = ListBox1.NoSelection
end if
Two methods created:
Method 1 - Name = (Pressed)
Code: Search TextField1.text
Method 2 - Name = (Search)
Code:
System.DebugLog CurrentMethodName
Var lb As Listbox = Listbox1
For row As Integer = 0 To lb.LastRowIndex
Var found As Boolean = False
For col As Integer = 0 To lb.ColumnCount-1
Var s As String = lb.CellValueAt(row,col)
If s.IndexOf(0, tx, ComparisonOptions.CaseInsensitive) >= 0 Then
found = True
End If
Next
lb.Selected(row) = found
Next
Var lb As Listbox = Listbox1
For row As Integer = 0 To lb.LastRowIndex
Var found As Boolean = False
For col As Integer = 0 To lb.ColumnCount-1
Var s As String = lb.CellValueAt(row,col)
If s.IndexOf(0, tx, ComparisonOptions.CaseInsensitive) >= 0 Then
found = True
End If
Next
lb.Selected(row) = found
lb.scrollposition = (row)
Next
Then, I read the explanation text and left the code…
Thank you; now I understand.
However, trying to display multiple selected Rows is not a good idea, especially if there are many rows between the first and last selections; this may lead to not display any Selected Row…