TreeNode.Clone() not supported ;(

  • Thread starter Thread starter Jeroen CEuppens
  • Start date Start date
J

Jeroen CEuppens

does anybody knows how I can clone a treenode in Compact Framework? I need
this because I add nodes from one list to another and it is possible that I
add 2 of the same nodes (so you need to clone it, because otherwise he will
give you an errormessage)

Thx
JC
 
Create a new treeview, then populate its properties from the one you want to
copy:-

TreeViewNode newnode = new TreeViewNode();
newnode.Text = oldnode.Text;
newnode.Tag = oldnode.Tag;

treeView1.Nodes.Add(newnode);

Peter
 
Back
Top