Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I set the parent property on a node of a treeview
Message
From
12/06/1998 18:03:18
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
11/06/1998 16:36:27
Jeroen Naus
Harte-Hanks Europe
Hasselt, Belgium
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00107357
Message ID:
00107756
Views:
16
>I'm trying to change the parent of a node on a treeview. Foxpro gives me an error doing this. Is there anyone out there that did this and made it work. According to the ACTIVEX Manual this property is setable at runtime.
>
>Command I'm using:
>thisform.treeview.nodes(lcKey).Parent=thisform.treeview.nodes(lcPar)
>also tried:
>thisform.treeview.nodes(lcKey).Parent=thisform.treeview.nodes(lcPar).object
>also tried:
>thisform.treeview.nodes(lcKey).Parent=thisform.treeview.nodes.index(lcPar)
>also tried:
>thisform.treeview.nodes(lcKey).Parent=lcPar
>...
I think the first one should work, but should use the numeric index to another node. Here's from the help:
------------------
Syntax
object.Parent[ = node]

Part Description
object An object expression that evaluates to a Node object.
node A Node object that becomes the parent of the object.

Remarks: At run time, an error occurs if you set this property to an object that creates a loop. For example, you cannot set any Node to become a child Node of its own descendants.
-------------------

Just check that this expression returns .t. :
Type("lcPar")="N" and Between(lcPar,1, thisform.treeview.nodes..count) and lcPar # lcKey

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform