TreeView + Icon

I have a treeview with 1 main node and several sub-nodes,

How can I hide the + sign in the main node?

Thanks,

+4
source share
3 answers

Treview Property: .ShowRootLines = false

When ShowRootLines is false, the plus / minus sign will not be displayed for the root node, but will still be displayed on child nodes if necessary.

With the Plus / Minus sign closed, you might consider running the Expand() method of the root node after populating the tree. This will ensure that the root of the node shows all the first level child nodes.

Note. TreeView has a ShowPlusMinus property, but it works on all nodes.

+11
source

See the TreeView :: ShowExpandCollapse property. Set it to false to disable the expand / collapse node indicators.

0
source

Sets the SiteMapDataSource ShowStartingNode property to false. For instance:

0
source

Source: https://habr.com/ru/post/888202/


All Articles