|
-
Jun 28th, 2003, 01:14 PM
#1
Thread Starter
Addicted Member
No more ListView.FindItem()?
Where's the ListView.FindItem function?
VB6 code:
VB Code:
Private Sub Command1_Click()
Dim FoundItem As ListItem
Set FoundItem = ListView1.Find("Something", 0)
If FoundItem Is Nothing Then
MsgBox "Not found"
Else
MsgBox "Found"
End If
End Sub
What about VB .NET?
Thanks.
Last edited by AlvaroF1; Aug 19th, 2003 at 03:38 PM.
-
Jun 28th, 2003, 06:08 PM
#2
Sleep mode
VB Code:
ListView1.Items.IndexOf(listviewitem)
-
Jun 29th, 2003, 12:16 PM
#3
Thread Starter
Addicted Member
But listviewitem cannot be a string, can it?
-
Jun 29th, 2003, 12:46 PM
#4
Sleep mode
Do you mean this way : This search for item (which is string) into the collection of listview . Output is the index 0 (if it's alone there)
VB Code:
Dim listviewitem As New listviewitem("aaaaa")
messagebox.Show (ListView1.Items.IndexOf(listviewitem))
-
Jul 1st, 2003, 01:52 AM
#5
Originally posted by Pirate
Do you mean this way : This search for item (which is string) into the collection of listview . Output is the index 0 (if it's alone there)
VB Code:
Dim listviewitem As New listviewitem("aaaaa")
messagebox.Show (ListView1.Items.IndexOf(listviewitem))
hmm but does that work? have you tried it? I dont have VS here to try it... someone let me know if it works, because if it does, I would feel really dumb 
I wrote this stupid little funciton a while ago, dunno how ti works, dunno if it has any limitations, don't feel like reading my own code
VB Code:
Public Shared Function ListViewFind(ByVal txt As String, ByVal lvw As ListView) As Integer
Dim li As ListViewItem
For Each li In lvw.Items
If li.Text = txt Then
Return li.Index
End If
Next
Return -1
End Function
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 2nd, 2003, 11:09 PM
#6
Thread Starter
Addicted Member
Thank you all.
VB Code:
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
-
Jul 3rd, 2003, 05:52 AM
#7
Sleep mode
So , it's working Mr.Polite . I thought I was going insane again .
-
Jul 3rd, 2003, 08:28 PM
#8
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Aug 19th, 2003, 03:40 PM
#9
Thread Starter
Addicted Member
MrPolite was right.
I'm testing this code and it's not working!
Sorry!
-
Aug 19th, 2003, 05:31 PM
#10
-
Aug 20th, 2003, 05:22 PM
#11
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
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
|