thanks for your reply
i tried this method .FindItemWithText but nothings happen. can you give me an idea on how to use indexof and looping method or case insensitivity?.
i just migrate from vb to vb.net. i already did this before in vb6 but wow! it's hard also in vb.net. here's my code
[XCODE] Dim itm As ListViewItem
Dim i As Integer
For i = 0 To lvUser.Items.Count - 1
lvUser.Items.Item(i).BackColor = Color.White
lvUser.Items.Item(i).ForeColor = Color.Black
Next
With lvUser
itm = .FindItemWithText(searchBox.Text, True, 0, True)
'tell me what im going to do in this line for searching that kind of method
If Not itm Is Nothing Then
.Items.Item(itm.Index).EnsureVisible()
.Items.Item(itm.Index).BackColor = Color.CornflowerBlue
.Items.Item(itm.Index).ForeColor = Color.White
.Items.Item(itm.Index).Selected = True
Else
MsgBox("No Record Found!")
For i = 0 To lvUser.Items.Count - 1
lvUser.Items.Item(i).BackColor = Color.White
lvUser.Items.Item(i).ForeColor = Color.Black
Next
.Items(0).EnsureVisible()
.Items.Item(0).BackColor = Color.CornflowerBlue
.Items.Item(0).ForeColor = Color.White
.Items.Item(0).Selected = True
searchBox.SelectionStart = 0
searchBox.SelectionLength = Len(searchBox.Text)
searchBox.Focus()
End If
End With
itm = Nothing
[/XCODE]