
08-01-2003, 04:45 PM
|
|
Freshman
|
|
Join Date: Nov 2002
Posts: 34
|
|
Selecting an item in Treeview control, without knowing its index.
|
How would you accomplish this?
I have a treeview control and a listview control.. I render files and folders from the harddrive, the problem is when I put the folders/subfolders in the listview control, and the user doubleclicks on it, I want the treeview control to automaticly select the folder/subfolder.
The best would be if you could set the selecteditem of the treeview control to a certain key value, instead of the index value.
A way to accomplish what I want would be to use a FOR-loop:
For i = 1 to treeview.nodes.count
if treeview.nodes.item(i).key = sKey then
set treeview.selecteditem = treeview.nodes.items(i)
next i
but wouldn´t this be very slow when there are maybee 5000 items in the treeview control?
Any suggestions?
Thanks.
|
|