Using the TreeView control in WinForms, is there a property that can be set to hide the collapse-node icons for each node?
Also, how do I permanently expand all nodes in the TreeView?
Using the TreeView control in WinForms, is there a property that can be set to hide the collapse-node icons for each node?
Also, how do I permanently expand all nodes in the TreeView?
You can intercept the
TreeView.BeforeCollapse
eventYou could try handling the
BeforeCollapse
event and setting thee.Cancel = true
, always.You would need to handle the
OnBeforeExpand
event and setCancel
totrue
.Keep in mind that this would prevent any tree node from expanding.
If you want to hide the "+/-" symbols, you should set the
ShowPlusMinus
property tofalse
.