We help IT Professionals succeed at work.

copy content of TTreeView Component

jeco
jeco asked
on
What is the easier way to copy the content of a TTreeView Component into another TTreeView component?
thanks
Comment
Watch Question

Commented:
there may another way (assign doesn't work) but you can try this:

var
 ms : TMemoryStream;
begin
 ms := TMemoryStream.create;
 treeView1.saveToStream(ms);
 ms.seek(0,soFromBeginning);
 treeView2.loadFromStream(ms);
 ms.free;
end;

GL
Mike
Commented:
Give this a try

TreeView2.Items.Assign(TreeView1.Items);


The Crazy one

Author

Commented:
simple, and works. That is how I like it.
Thanks!

Commented:
Ummm, ya, that's right. Think Mike! Sometimes one types somewhat faster then they think ;P .

GL
Mike

Commented:
You are welcome.

Hi Mike. :>)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.