I want my TreeNodes to have extra properties so i've extended the TreeNode Class and add a few new properties, but i need to extend the UltraTree Class so i can add this new nodes instead of the traditional nodes, how can i acomplish this,
if Rectangle is the parent, and Square is the child, then you can safely assume that every Square is a rectangle, but not every rectangle is a square. So you can treat any square as if it were a rectangle.
You'll have to override the Nodes to accept your MyTreeNodes type instead.
If your just adding properties then the inherited TreeView may be able to pick up the originals and draw them itself. However if any of your extra properties should cause it to display differently then you'll have to draw the TreeView parts yourself.
To ThatRickGuy: that's just how I feel, but some while ago I was discussing in another thread about this and it is not the way VS thinks. I suggested that every chimpansee is a monkey, so if a method asks for a monkey, I should be able to give it a chimpansee, right? I was corrected though, it doesn't work that way. I can't find the thread anymore though
Regards, Ruffnekk
---
Is it my imagination or do buffalo wings taste just like chicken?
nunob, just remember that when you pull a node out of the tree now you'll have to cast it to your new custom node type. And do so carefully as it is possible that you have pulled out a node that is note one of your new nodes.
Ruffnekk, I think I remember that thread. But I'm pretty sure the issue being debated there was not if every square was a rectangle, but could a rectangle be treated like a square.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.