That doesn't work, TreeView is a reference type. After that assignment, treeView1 will just be referencing treeView2 and any changes you make to treeView1 will be visible on the screen. Not sure what you are really trying to do, it doesn't make sense to keep a copy of a TreeView in memory. Maybe keep a copy of the nodes. That's hard too, TreeNodeCollection doesn't have a Clone() method. It's CopyTo() method is a weak alternative.
Hans Passant.- Marked As Answer byKira QianMSFT, ModeratorTuesday, September 22, 2009 6:31 AM
-
|