Listview Scrolling & Highlight
How can I keep the first row in my listview highlighted even when I am typing in a textbox? that is, when the textbox has the focus, the first row turns gray.
And how do I stop the listview from scrolling when I type in the textbox to search the listview? I would like when the text is found, it always at the top.
Listview Scrolling & Highlight
This loads the listview. FullRowSelect is on.
First row is grayed out when listview loses focus.
Private Sub LoadListView()
Dim Items as Listitems
Do Until rst.EOF
'Add List Items
Set Items = lsv.ListItems.Add(, , rst!fieldname)
Items.SubItems(1) = rst!fieldname
Items.SubItems(2) = rst!fieldname
Items.SubItems(3) = rst!fieldname
Items.SubItems(4) = rst!fieldname
rst.MoveNext
Loop
lsv.SelectedItem.EnsureVisible
End Sub
This searches listview.
But I would like when text is found, the selected row is always at the top
Set itmFound = lsv.FindItem(txtGetText, , , lvwPartial)
If Not itmFound Is Nothing Then
itmFound.Selected = True
itmFound.EnsureVisible
itmFound = lsvZip.SelectedItem
End If