User object with TreeNode in C #

Is it possible to associate a user object with a TreeNode in C #?

+3
source share
1 answer

Yes. You can use the Tag property to store any custom object for a particular node tree.

http://msdn.microsoft.com/en-us/library/system.windows.forms.treenode.tag.aspx

TreeNode node = CreateATreeNode();
node.Tag = myStateObject;
+12
source

Source: https://habr.com/ru/post/1704628/


All Articles