Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking if a node exists in a treeview and selecting it
Message
De
24/11/2006 02:08:24
 
 
À
23/11/2006 22:19:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6
Divers
Thread ID:
01172177
Message ID:
01172199
Vues:
15
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform