"Tony Johansson" <(E-Mail Removed)> wrote in message
news:ihk25l$qnf$(E-Mail Removed)...
>>> When I look in the toolbox I can't find the TreeNode. but the TreeView
>>> control is there
>>> Is it meant that I should enter the TreeNode control by hand.
>>> I have looked everywhere in the Toolbox but no TreeNode control.
>>
>> The toolbox only contains "standalone" controls. A tree node must belong
>> to a tree view, so it isn't standalone, and therefore you won't find it
>> in the toolbox. What in the world are you trying to do that you think you
>> need to put a tree node directly on a form?
>>
> I do know that a TreeNode must belong to a TreeView but I just thought
> that when a TreeView exist then a TreeNode would also exist.
If you were hoping to drop a tree view onto a page and then start dragging
tree nodes onto it, it just doesn't work that way. However, the TreeView
control has an Edit Node command which brings up a dialog to declare nodes
at design time if you don't want to write code.
Here's a hint for determining whether or not something ought to appear in
the toolbox or not: look at its inheritance hierarchy. If one of the class's
ancestors doesn't have "control" or "component" somewhere in its name, you
almost certainly won't find it in the toolbox.
TreeView looks like this:
public class TreeView : HierarchicalDataBoundControl, IPostBackEventHandler,
IPostBackDataHandler, ICallbackEventHandler
TreeNode like this:
public class TreeNode : IStateManager, ICloneable
|