שתף באמצעות


Check if ListView Contains an Item

Question

Saturday, October 18, 2008 11:55 PM

I want to check if a multi-column ListViewBox contains an item.


Please vote for my answers!!!

All replies (1)

Sunday, October 19, 2008 7:49 AM ✅Answered | 1 vote

Try this code. You might have to change the index (highlighted) as per the list view column.
 

        Dim _itm As ListViewItem  
 
        For Each _itm In ListView1.Items  
            If (_itm.SubItems(0).Text).ToString.Equals("SearchString") Then  
                MsgBox("Match found.")  
                Exit For
            End If  
        Next