Can Anyone add control in TreeView Control?

Hey all .net programmers..

I am thinking about Tree View control which contains controls. any idea?


Microsoft Tree View control only support add nodes as text. i think. but istead of text, putting Button or link or any usercontrol.. what do u think?

[481 byte] By [vbnetdiscuss] at [2007-12-28]
# 1

You can customize the treeview by overriding the behavior of each node (to add additional properties, for example) or render it in a certain way, such as the Outlook 2003 Folders treeview. It's highly extensible: you could add all sorts of 'objects' to a node.

I'm not sure what you are really asking: can you do it (add user controls)? I'm sure you could. Should you do it? I don't know - sounds like an end user nightmare. A link or a button could be rendered in a node if that's what you want. Suck it and see, that's what I say :)

SJWhiteley at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2

What you're trying to do is not possible with the builtin TreeView in System.Windows.Forms. The TreeNodes while having a great deal of customization are still essentially drawn by the TreeView control itself.

I'm sure this restriction stems in some way from the TreeView being a very thin wrapper around the Win32 tree view control.

JaredParsonsMSFT at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3

Can u add button in treenode?

if yes give me some ideas.

thankx in advance

vbnetdiscuss at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 4
Since you can't add true controls - since the treeview isn't a container - you would need to simulate it by overridng the paint event (or node paint, I can't remember) and draw the control in and respond to it.
SJWhiteley at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 5

After reviewed this link:

http://www.codeproject.com/Purgatory/Button_TreeView_Control.asp

Clearly it is possible... Anyone scene this implemented so we can add a user control and not just a button? Could use the help....

Felice

felice200 at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...