|
-
October 23rd, 2001, 09:09 AM
#1
listview
Hi,
I have a listview and I add items like this
myLV.AddItem ,"k1", "Hello"
myLV.AddItem ,"k2", "Hi"
myLV.AddItem ,"k2", "etc."
...
then I want to find an item using the key.
I realize I can iterate all items one by one,
but is there faster way to find an item by key?
thanks.
Valery Iskarov Nikolov
Software Dynamics
-
October 23rd, 2001, 09:46 AM
#2
Re: listview
What listview control are you using? The one I have (Microsoft's) doesn't have an AddItem method???
-
October 23rd, 2001, 09:54 AM
#3
Re: listview
ok, my mistake, in my post instead of
myLV.AddItem ,"k1", "Hello"
myLV.AddItem ,"k2", "Hi"
myLV.AddItem ,"k2", "etc."
I should have written
myLV.ListItems.Add ,"k1", "Hello"
myLV.ListItems.Add ,"k2", "Hi"
myLV.ListItems.Add ,"k2", "etc."
Valery Iskarov Nikolov
Software Dynamics
-
October 23rd, 2001, 10:13 AM
#4
Re: listview
I think it can be used interchangeably anytime you would normally use the "index" parameter as in:
private Sub Command1_Click()
MsgBox ListView1.ListItems("K2").Text
End Sub
private Sub Form_Load()
ListView1.ListItems.Add , "K1", "One"
ListView1.ListItems.Add , "K2", "Two"
ListView1.ListItems.Add , "K3", "Three"
End Sub
-
October 23rd, 2001, 10:25 AM
#5
Re: listview
You are quite right,
Thanks,
Valery Iskarov Nikolov
Software Dynamics
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
|