Extend TreeNode class

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
 
M

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!
 
S

Saulot

Try this :

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top