This is a set of drop-down controls for Windows Forms that add a hierarchical dimension to their list items. They utilise visual styles and the Buffered Paint API to provide consistency with standard controls.
- Visual style rendering
Extends the standard
ComboBox control by adding a
GroupMember property (in addition to the familiar
ValueMember properties). This allows you to display the drop-down list items in groups. The grouping functionality uses the
PropertyDescriptor mechanism, thus it is compatible with data-binding. Although owner-drawn, the control overcomes the inconsistent visual style problem inherent to the combo box control by using visual style rendering and the Buffered Paint API.
You can use the
GroupedComboBox control as a drop-in replacement whenever you need to display list items in groups.
- Tree structure for list items
- Offers similar features to the
- Nodes indexed by key
- Node images
- Font styles
- Path separator, get/set node by its path
- Passive drop-down (does not steal focus)
- Support for multiple selected nodes (using checkboxes)
- Visual style rendering
This drop-down control is built from the ground up to provide a tree-based data structure instead of a flat list. The nodes are similar to the built-in
TreeNode class, offering font styles, images and the ability to index according to the Name property. By using
ToolStripDropDown, its popup does not steal focus and provides a seamless user experience. When dropped down, the user can hover and scroll in the usual manner, but clicking the plus/minus glyphs will expand and collapse child nodes. The standard
TreeView keyboard shortcuts are also implemented. You can optionally display the full path to the selected node in the main part of the control; the path separator is configurable. A recursive enumerator is also included to assist in walking the nodes.
The control also supports multiple selected items via the use of the
CheckedNodes properties. In this mode of operation, normal selection rules are suspended and checkbox glyphs are displayed beside each item. You can decide whether parent nodes behave independently of their children or not. As you check individual nodes, the main part of the control displays their concatenated text.
ComboTreeBox control in situations where your list items have an n-depth tree structure, a grouped structure with large numbers of items or even when you have a flat list for which you need multi-select functionality.
Custom DataGridView column types
Also included with the latest version of the project are custom column types (based on the above controls) that can be used in the
- .NET Framework 3.5 or 4.0 (works with both runtime versions)
If you find my code useful, please consider making a donation.
Current version: 1.0.7
ComboTreeBoxnow supports a
- Fixed rendering node images for
ComboTreeBoxif all nodes are depth 0.
Previous version: 1.0.6
GroupedComboBoxnow allows custom sorting via a new
ComboTreeBoxnow supports tooltips for nodes.
ComboTreeDropDownnow supports scrolling with the mouse wheel.
.NET Framework 4.0 – dropdowncontrols-1-0-7-bin.zip
.NET Framework 3.5 – dropdowncontrols-1-0-7-bin-net35.zip
Visual Studio 2012 solution (includes demo app) – dropdowncontrols-1-0-7-src.zip
A ComboBox with Grouping
A ComboBox with a TreeView Drop-Down
Painting Controls With Fade Animations Using the Buffered Paint API
Drop-Down Controls Revisited
DataGridView Column Types for Drop-Down Controls