Hello, in my form i got one textbox , one listview and one buttoni want that when i click the button1 ,the program check out if there are already an item in the listview with the textbox1 value (a file path , so its string)here is my code :Code: For Each item As ListViewItem In ListView1.Items If item.ListView.Items(0).Text = Textbox1.Text Then MsgBox("the file exists in the listview") Return ElseIf item.ListView.Items(0).Text <> Textbox1.Text Then MsgBox("the file DOESN'T exists in the listview") Return End If Nextthe problem is , i think the execution of this code isn't really smooth , and it check only for the first item , not on the others , i want to make it check if that value exists an all items in the listview (but not in the sub-items) .thanks you very much , please be quick if you can .
For Each item As ListViewItem In ListView1.Items If item.ListView.Items(0).Text = Textbox1.Text Then MsgBox("the file exists in the listview") Return ElseIf item.ListView.Items(0).Text <> Textbox1.Text Then MsgBox("the file DOESN'T exists in the listview") Return End If Next