Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding a node in a treeview with the Key or FullPath
Message
De
22/09/2000 03:59:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00419077
Message ID:
00419585
Vues:
21
>>The Nodes collection will return a reference to a node from the key value, but not from Fullpath. For that, you'd have to walk through the collection, which I'd avoid if possible <s>.
>
>OK. Does the nodes collection contain ALL the nodes in the entire treeview? For some reason I thought a node had a nodes collection as well (that contained any nodes below it and so on). I doesn't appear to in the help. I'll play around with it and figure it out.
>
>Thanks.


nodes is a property of treeview itself and refer to 'all' nodes. A node object has Child, firstsibling, lastsibling, next, previous, parent, root properties in turn (clever as fox:) Below is a code portion listing children nodes in edit1 :
*Nodeclick
*..
WITH this
 .DropHighlight = .null.
 If node.Children > 0
  thisform.Edit1.Value = "Current childs of this node :" + chr(13) + ;
                         "-----------------------------" + chr(13) + ;
                          Node.Child.Text
  lnIndex  = Node.Child.Index
  do while lnIndex # Node.Child.LastSibling.Index
   thisform.Edit1.Value = thisform.Edit1.Value + chr(13) + ;
                          .Nodes(lnIndex).Next.Text
   lnIndex = .Nodes(lnIndex).Next.Index
  enddo
 EndIf
ENDWITH
Good thing index is not fixed vs key. OTOH if you have say a thousand children < g > and don't know the keys finding 999th is not very fast.
You're right documentation says nodes apply to node also. It also says node object has an Item property. Honestly I couldn't make both of them work up to date.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform