Here what I use to search for the text in the listview, the thing is as you can see it is going to select the last value that has that text, what I want is stop at the first one and be able by pressing the button again to select the next line that has the text
Private Sub CmdBgtSearchLOBJ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdBgtSearchLOBJ.Click
For Each lv In LstBgtLOBJ.Items
'Check if the description is in the list
If TxtBgtLOBGJDescription.Text.CompareTo("") = 1 Then
If lv.SubItems(1).Text.ToLower.IndexOf(TxtBgtLOBGJDescription.Text.ToLower) >= 0 Then
lv.Selected = True
LstBgtLOBJ.Items(lv.Index).Selected = True
LstBgtLOBJ.EnsureVisible(lv.Index)
LstBgtLOBJ.Focus()
End If
Exit For
End If
Next
End Sub