|
-
Oct 10th, 2002, 06:42 PM
#1
Thread Starter
Junior Member
Finding items in a LISTVIEW Control
Does anyone know how to find an item in a LISTVIEW control?
In VB6 there was a FINDITEM method that you could use. I dont see that method in .NET
In VB6 you could do this:
Set itmFound = lstConnections.FindItem(Name, lvwSubItem)
If itmFound Is Nothing Then
'do nothing
Else
lstConnections.ListItems.add (name)
End If
In vb.net????
I could loop through all the items.....yuch...any ideas?
-
Oct 10th, 2002, 07:18 PM
#2
Addicted Member
The only way that I am aware of is to loop through the items.
Dim A As Windows.Forms.ListViewItem
For Each A In ListView1.Items
If A.Text = "What you are looking for" Then
MsgBox("Item Fount At:" & A.Index)
End If
Next
Jeremy
-
Oct 10th, 2002, 10:06 PM
#3
Thread Starter
Junior Member
Looping I guess it is......
I was hoping for a slicker way but I guess looping will have to suffice. Thanks for your help!
-
Oct 11th, 2002, 01:54 AM
#4
Fanatic Member
Yeah I've been looking for a way to find items in a listview and that's the only way I came up with also (looping).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|