Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking if a node exists in a treeview and selecting it
Message
From
24/11/2006 02:08:24
 
 
To
23/11/2006 22:19:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01172177
Message ID:
01172199
Views:
14
>Hi,
>
>I'm working on a treeview. I want to check whether there is a node in it and if yes, I want to select it.
>
>How can I do this? Pls help. TIA.

Evelyn,

See thread#853186 for further reading

2 possibilities
(1) Keep a cursor, when you add a node, insert the key into the cursor.  When you remove a node, remove the key from the cursor
Testing for a node is then a seek()

(2) loop through the nodes collection
<pre>
with thisform.treeview.Nodes
   for i = 1 to .Count
       if( .Item[ m.i ].Key = 'TheKeyIAmLookingFor' )
           return TRUE
       endif
   endfor
endwith
return FALSE
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform