I have a text box and a '4' column ListView on a form.
When the user types into the text box I have got it to auto-complete and also highlight the selection in the listview.
What I would like it to also do is:
- Check against a different column in the listview than the first column
- Scroll the listview to show the selected item
- Highlight the listview as in THIS threads post #1
I have used this code, from the above thread, which partially does what I am after:
vb Code:
Private Sub txtSearch_Change()
'Run through the available items and grab the first matching one.
Dim LvwItm As ListItem
Dim Strt As Integer
lvwMembers.FindItem(txtSearch.Text, , , 1).Selected = True
'If something was chosen then we get the rest of it
Strt = Len(txtSearch.Text)
txtSearch.Text = lvwMembers.SelectedItem.Text
txtSearch.SelStart = Strt
txtSearch.SelLength = Len(txtSearch.Text) - Strt
End Sub