Hello,
in my form i got one textbox , one listview and one button
i 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:VB.NETFor 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
the 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 .
Check out if a value exists on the listview
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Sep 30, 2012, 12:23 AM EDT