I am searching my listview from a specified index and returning the first result(the index the item is on) of the word. It works good except I can only search the first column in the listview. How can I search only the second column?
Private Function FindLogic(ByVal LV As ListView, ByVal CIndex As Integer, ByVal SearchFor As String) As Integer
Dim idx As Integer
Dim It = From i In LV.Items Where i.index > CIndex And i.Text = SearchFor
If It.Count > 0 Then
idx = It(0).Index
Else
idx = -1
End If
Return idx
End Function
I have figured it out. This solution allows you to choose a specified index to begin the search from and checks the column with and index of 1.(Which is usually your second column)
You could also add another parameter into the function so you could choose a different column to check for the string, like this:
To use this function, it would look like this:
You could also have it search from a selected item like this: