I have a TreeView on my form but I'd like it to always be fully expanded, even the child nodes.
Is there a way?
I have a TreeView on my form but I'd like it to always be fully expanded, even the child nodes.
Is there a way?
Guessing here... On the BeforeCollapsed event, set e.Cancel = true;
TreeView.ExpandAll().
See http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.expandall%28VS.71%29.aspx
Do you want it to initially display expanded? If so, then call the ExpandAll
method on the root node after you have added all of the tree nodes.
If you want it to display expanded and not allow the user to collapse it, then you need to handle the BeforeCollapsed
event and cancel it.