Can i tie a user object to a TreeNode in C#?
+2
A:
Yes. You can use the Tag property to store any user object for a particular tree node.
http://msdn.microsoft.com/en-us/library/system.windows.forms.treenode.tag.aspx
TreeNode node = CreateATreeNode();
node.Tag = myStateObject;
JaredPar
2009-03-12 04:29:34
Perfect answer. I'd like to add that on a _AfterSelect event use ((TreeView)sender).SelectedNode.Tag;
acidzombie24
2009-03-12 04:50:37