469,623 Members | 923 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Cloning TreeNodes Question

Greetings all;

Got some questions about cloning a treenode....

In this example:

private void button4_Click(object sender, System.EventArgs e)
TreeNode lastNode = treeView1.Nodes[treeView1.Nodes.Count - 1].
Nodes[treeView1.Nodes[treeView1.Nodes.Count - 1].Nodes.Count - 1];

// Clone the last child node.
TreeNode clonedNode = (TreeNode) lastNode.Clone();

If I declared clonedNode as a public TreeNode should it be available to other parts of my program. Will it be holding a copy of the cloned node???

// Insert the cloned node as the first root node.
treeView1.Nodes.Insert(0, clonedNode);

MessageBox.Show(lastNode.Text +
" tree node cloned and added to " + treeView1.Nodes[0].Text);

Thanks in Advance
Nov 16 '05 #1
0 943

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by kurotsuke | last post: by
3 posts views Thread by Kilroy Programmer | last post: by
8 posts views Thread by Tom | last post: by
3 posts views Thread by AVL | last post: by
1 post views Thread by Dan Dorey | last post: by
reply views Thread by Chris | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.