General information
Category:
ActiveX controls in VFP
> 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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only