>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