Extend TreeNode class

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

How can I extend the TreeNode class to add a .tag2 property? I was able to
do that, the problem is: how can I tell a TreeView control to use my class
(TreeNodeExt) for its nodes, instead of the default one (TreeNode)?

Thanks,

Marco
 
To clarify the question, I'd need that when I do Treeview1.SelectedNode, it
would return my TreeNodeEx, not TreeNode, otherwise I cannot get the .Tag2
property. Maybe should I simply CAST .SelectedNode?

Thanks!
 
Try this :

Creation :
Treeview.Nodes.Add(New TreeNodeEx(param1,param2,...))

Get Tag :
Ctype(Treeview.SelectedNode, TreeNodeEx).Tag2
 
Back
Top