| View previous topic :: View next topic |
| Author |
Message |
ericgm Newbie
Joined: 09 Aug 2004 Posts: 2
|
Posted: Aug 9th, 2004 08:50 AM Post subject: equivalent of listview.finditem |
|
|
guys can anyone show me how to do the VB.net the equivalent of listview.finditem method.
i appreciate your help.
thanks
eric |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Aug 10th, 2004 02:01 AM Post subject: |
|
|
Something like this? (I haven't tested it)
[vb:1:3b6f722bd4] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FoundItem As New ListViewItem("Something")
If ListView1.Items.IndexOf(FoundItem) = -1 Then
MsgBox("Not found")
Else
MsgBox("Found")
End If
End Sub[/vb:1:3b6f722bd4] _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
ericgm Newbie
Joined: 09 Aug 2004 Posts: 2
|
Posted: Aug 10th, 2004 07:31 AM Post subject: |
|
|
hi all, thanks for your time;
i was hoping to implement an equivalent of vb6 listview.finditem method to VB.NET.
i am still new to VB.NET and i am quite confused with the objects and collections of
list items.
i need to find a text item or a list item on a given list in a list view control,
as of now i just loop through the list (w/c has more than 200) to find it,
using this
| Code: | For n = 0 To lvCustomers.Items.Count - 1
If lvCustomers.Items(n).Text.StartsWith(sFind) Then
nIndex = n
Exit For
End If
Next |
is it also possible to find partial items?
i just miss the VB6 method of finding through a listview;
thanks again |
|
| Back to top |
|
|