Board index » cppbuilder » Copying a TTreeNode to a different TTreeNodes

Copying a TTreeNode to a different TTreeNodes

I have two TTreeViews.  I wish to copy or move a subtree from one
treeview into the second treeview as its whole tree.

I think this boils down to assigning an existing TTreeNode to an
existing TTreeNodes - is this possible?

Andrew Dunbar
Channel 1

 

Re:Copying a TTreeNode to a different TTreeNodes


From BCB help :

If the Source parameter is a TTreeNode object, Assign copies the Text,
Data, ImageIndex, SelectedIndex, OverlayIndex, Focused, DropTarget, Cut,
and HasChildren properties from the source node. If Source is any other
type of object, Assign calls its parent class's method, which copies
information from any object that can copy to a tree node in its AssignTo
method.

***Note***:     While Assign copies the HasChildren property, it does not
copy the child nodes. Be sure to copy any descendants after assigning
the properties of another node that has children.

Quote
Andrew Dunbar wrote:

> I have two TTreeViews.  I wish to copy or move a subtree from one
> treeview into the second treeview as its whole tree.

> I think this boils down to assigning an existing TTreeNode to an
> existing TTreeNodes - is this possible?

> Andrew Dunbar
> Channel 1

Best regards,
_______________________________________
Yuri Lapitsky
Software Engineer Telesens Ukraine Ltd.
e-mail: Y.Lapit...@telesens.com.ua

Other Threads