Link to home
Start Free TrialLog in
Avatar of dave_p_r_b
dave_p_r_b

asked on

"Nodes" property in the TreeView control

hello,
I wanted to derive a class from "TreeNodeCollection". (e.g. TreeView.Nodes Property).

Can anybody give a quick explaination as to why they would want to prevent the programmer deriving from this class?

Thanks,
D.
ASKER CERTIFIED SOLUTION
Avatar of SRigney
SRigney
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dave_p_r_b
dave_p_r_b

ASKER

Thank you.


TreeView myTV;
myTV.Nodes.Add(myTreeNode);

I wished to add extra functionality to the TreeNodeCollection.Add() function to do some extra checks. If, according to my additional checks, it was not ok to add the node then .Add() would return without adding to the collection.

I need to compare the node that is being added to the existing nodes.

I guess I'm going about this the wrong way.