Table of Contents

ExTreeView

ExTreeView is a TreeView whose nodes can be hidden without removing them, with the Explorer theme of Windows in a light or dark variant.

Hidden nodes

ExTreeView.Nodes is an ExTreeNodeCollection: it contains all nodes, including the hidden ones, while the underlying TreeView.Nodes contains only the visible ones.

tree.Nodes.SetVisibility(advancedNode, false);   // the node stays in the collection
bool visible = tree.Nodes.GetVisibility(advancedNode);
tree.Nodes.SetVisibilityForAll(true);

SetVisibility and GetVisibility also take an index or a key. TreeNodeAdded and TreeNodeRemoved report changes of the collection. ExOptionsView uses the hidden nodes to filter its pages by the search text.

Style

Style (ExTreeViewStyle) chooses the look of the expand buttons and the selection:

Value Look
Default The default theme of the tree view.
Light The Explorer theme with arrows, as in Windows Explorer.
Dark The dark Explorer theme.
Old No theme, the classic look with plus and minus signs.

Theme

The theme sets BoxBackColor and BoxForeColor, also in the system style. In the custom style a tree with a border gets a 1 px border in BorderColor (BorderStyle.FixedSingle, ExTools.SetBorderColor), a tree without a border stays without one. DarkScrollBars switches the scroll bars and the expand buttons to the dark Explorer theme; without them the tree returns to the theme of its Style.

API