Question

Can i tie a user object to a TreeNode in C#?

Was it helpful?

Solution

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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top