ExOptionsView
ExOptionsView is a settings window like the options of Visual Studio: a searchable tree of pages on the left and the
selected page on the right, with the path of the page in a header.
Pages
Every page is an ExOptionsPanel in the Panels collection of the view. Its NodeText is the text of its node in the
tree, ParentNode makes it a child of another page. The designer edits the pages with a collection editor
(see Visual Studio designer); in code the view is initialized like this:
var view = new ExOptionsView { Dock = DockStyle.Fill };
((ISupportInitialize)view).BeginInit();
var environment = AddPage(view, "Environment", parent: null);
environment.GenerateLinksToChildren = true; // the page lists links to its child pages
var general = AddPage(view, "General", environment);
general.Controls.Add(restoreDocumentsCheckBox);
form.Controls.Add(view);
((ISupportInitialize)view).EndInit();
view.SelectedPanel = general;
static ExOptionsPanel AddPage(ExOptionsView view, string text, ExOptionsPanel? parent)
{
var panel = new ExOptionsPanel(view);
view.Panels.Add(panel);
panel.Node = new OptionsNode { Text = text };
panel.NodeText = text;
panel.ParentNode = parent?.Node;
return panel;
}
SelectedPanel shows a page and raises SelectedPanelChanged, ShowPanel(name) selects a page by its Name.
Search
The search box above the tree hides the pages that don't contain the text: a page matches when its node text or the
text of any control in it contains the search text. Controls that implement ISearchable, such as
ExPropertyGrid, search in their own content. The first matching page is selected.
Labels, check boxes and radio buttons that match get a background in SearchHighlightColor. Empty means light yellow on
a light page and dark amber on a dark one. ExOptionsPanel.HighlightMatches(text, color) does the same for a single
page.
Layout and colors
| Property | Description |
|---|---|
TreeWidth |
Width of the tree with the search box. |
SearchBoxVisible |
Shows the search box. |
HeaderNodeNameVisible, HeaderNodeNameFont |
The header with the path of the selected page. |
HeaderNodeNameForeColor, HeaderNodeNameBackColor |
Colors of the header. |
LinkToChildrenForeColor |
Color of the links to child pages. |
TreeView, SearchBox, ToolStripMenu, PanelContainer |
The parts of the view, for example TreeView.Style. |
Theme
The view applies the theme to all pages, the tree, the search box and the tool strip. The header takes LabelForeColor
on PanelBackColor, the links to child pages HighlightBackColor.


