Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nodes order in treeview
Message
From
15/10/2000 02:31:27
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00428492
Message ID:
00429578
Views:
16
>.. to assess if current node is last node in tree, you might ..
>if NOT vartype(MyForm.MyTreeView.Nodes(lcCurrentNodeKey).Next=="O" && Then current node is last
>.. and so on.
>
>We also have LASTSIBLING, FIRSTSIBLING, SIBLING, PARENT and others
>HTH:
>

Hi Terry / Bruno,

Thanks for the response and spending your time. This is exactly what I have done if you see the below code. I need to store the .Text values in a cursor in the same order that they are displayed on the treeview (assume that it is fully expanded).
--------
Local oCurNode, nTreeLevel
oCurnode = ThisForm.oleTvwAc.Nodes(i)
nTreeLevel = 0
Do While VarType(oCurNode) = "O"
   .....
   * Store the values in my cursor
   .....
   
   * check if there are children to this node
   If !Empty(oCurNode.Children)
      oCurNode = oCurNode.Child
      nTreeLevel = nTreeLevel + 1  && to go back to the parent node later
      Loop
   EndIf
   * No children. But check if it is a last node in this parent node
   If oCurNode.Key = oCurNode.LastSibling.Key
      oCurNode = oCurNode.Parent.Next
      Do While VarType(oCurNode) <> "O" And nTreeLevel > 0
         oCurNode = oCurNode.Parent.Next
         nTreeLevel = nTreeLevel -1
      EndDo
   Else
      * Move it to the next node
      oCurNode = oCurNode.Next
   EndIf
EndDo
oCurNode = .Null.
---------
This code works fine. (Actually I am at home now, and have typed this code from memory but the code at work place must be the same).

My problem is, the moment I execute the option where this code is put, the form would not close afterwards if I press the close ('x') button on top. Form does not release till I quit the application. Thanks to Fred Tylor of this forum I found out that the culprit could be the pointer 'oCurNode' and it does not release the treeview object, so the form is not closing.

Now is there an alternative way, so that my form would also close?

Thanks in advance

Regards
Vijay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform