I use a search box to locate a matching row in a Web listbox. I can find it, highlight it, but cannot get it to scroll so that it is showing (like at the top of the listbox).
For i As Integer = 0 to lstAccounts.RowCount -1
If lstAccounts.CellTextAt(i, 0).IntegerValue = SID Then // TextValue = trim(Me.text) Then
Row = i
lstAccounts.SelectedRowIndex = Row
lstAccounts.SelectedRowColor = Color.Blue
What is the correct method to accomplish this?
Can you provide a sample app?
A simple app without highlight works:
Is my code correct to make it move? Or am I missing something?
The code presented, other than filling the listbox, is all that I have at the moment, but it is part of a much bigger project.
Used the code you posted here, and this is the result:
macOS, Chrome, Xojo 2023r2 (Firefox, Safari working too)
This is the code used for button ‘To 176’
Var row As Integer
For i As Integer = 0 To listbox1.RowCount -1
If listbox1.CellTextAt(i, 0).IntegerValue = 176 Then // TextValue = trim(Me.text) Then
Row = i
listbox1.SelectedRowIndex = Row
listbox1.SelectedRowColor = Color.Blue
It does appear to work as you have shown…
I found the cause. Since 2023R2 is running so slow, I used 2023R1.1. It looks like there were some definite improvements made to the web listbox in the 2023R2 release.