Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Treeview, Node Index
Message
 
To
14/03/2000 09:48:16
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00345309
Message ID:
00345325
Views:
18
> I have a treeview with several nodes & child nodes. When I dblclick on a node I'd like to know the index number or which node I dblclicked. What I am trying to do is:

>DO CASE
Case .node.index == 1 && Need proper syntax here
! /N T:\dirname\filename
THISFORM.WINDOWSTATE = 1
Case .node.index ==2
! /N T:\dirname\filename
THISFORM.WINDOWSTATE = 1
ENDCASE

>Not sure that this is the best aproach. Any & all sugestions are welcome.

>TIA
>Mike

Mike,

.oleTree.SelectedItem.Index
This approach is fine provided the order of the nodes does not change. The index is assigned in the order that the nodes are added to the tree.

Another approach is to to reference the key, if it is meaningful...
.oleTree.SelectedItem.Key

..., or to determine it's position in the heirarchy...
IF ISNULL(.oleTree.SelectedItem.Parent)
* This is a top level node
~
~

Phil
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform