Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Interface & Graphics

Post new topic   Reply to topic
equivalent of listview.finditem
View previous topic :: View next topic  
Author Message
ericgm
Newbie


Joined: 09 Aug 2004
Posts: 2

PostPosted: Aug 9th, 2004 08:50 AM    Post subject: equivalent of listview.finditem Reply with quote

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
View user's profile Send private message Yahoo Messenger
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Aug 10th, 2004 01:13 AM    Post subject: Reply with quote

Hello ericgm,

You mean you want it in VB.Net or VB 6 ?

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Aug 10th, 2004 02:01 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
ericgm
Newbie


Joined: 09 Aug 2004
Posts: 2

PostPosted: Aug 10th, 2004 07:31 AM    Post subject: Reply with quote

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; Biggrin


thanks again
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET Interface & Graphics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic