TreeViewFolderBrowser
Supports Explorer, SingleChecked and RecursiveChecked mode (checkboxes). Lets you specify the displayed drive types etc..
Install / Use
/learn @ChrisRichner/TreeViewFolderBrowserREADME
TreeViewFolderBrowser
Supports Explorer, SingleChecked and RecursiveChecked mode (checkboxes). Lets you specify the displayed drive types etc..

Based on popular demand in the discussion area I've decided to put the latest code out in the wild. The software is provided "as is". Bear in mind that this is an early 3.0.0 Version which never made it's way to codeproject.com.
Introduction
This tree view control gives you the ability to control which drive types are displayed to let the user choose directories. A possible scenario is to show only local drives, because your Application scan the selected directories and fill a database with the generated meta data, and it makes no sense to allow directories from removable drives.
Design
Introduction
This release has a new design which is based on a tree view which aggregates a tree view data provider interface (Strategy pattern). The goal of the new design is to provide an easy way to extend or add data providers without changing a single line of tree view code. Basically the tree view interface will not change so far, but the data providers will change their behavior and features.

TreeViewFolderBrowser class defines the following core requirements
- DriveTypes
- RootFolder
- CheckboxBehaviorMode
and is responsible to manage the checkboxes and the internal selected directories list.

ITreeViewFolderBrowserDataProvider is used by aTreeViewFolderBrowser instance and is responsible to
- retrieve the computer drives and directories
- Imagelist which is used to assign images to the nodes created by this instance
- ContextMenu
and can provide custom features and behavior to extend theTreeViewFolderBrowser class.
TreeViewFolderBrowser
You can specify the drive types through a public instance property on the control. The enumeration can be treated as a bit field, that is, a set of flags.
<table id="table2" cellspacing="0" class="dtTABLE"><tbody><tr valign="top"><th width="50%">Member Name</th><th width="50%">Description</th></tr><tr valign="top"><td width="50%">**NoRootDirectory**</td><td width="50%">NoRootDirectory</td></tr><tr valign="top"><td width="50%">**RemovableDisk**</td><td width="50%">Drive has removable media. This includes all floppy drives and many other varieties of storage devices.</td></tr><tr valign="top"><td width="50%">**LocalDisk**</td><td width="50%">Drive has fixed (nonremovable) media. This includes all hard drives, including hard drives that are removable.</td></tr><tr valign="top"><td width="50%">**NetworkDrive**</td><td width="50%">Network drives. This includes drives shared anywhere on a network.</td></tr><tr valign="top"><td width="50%">**CompactDisc**</td><td width="50%">Drive is a CD-ROM. No distinction is made between read-only and read/write CD-ROM drives.</td></tr><tr valign="top"><td width="50%">**RAMDisk**</td><td width="50%">Drive is a block of Random Access Memory (RAM) on the local computer that behaves like a disk drive.</td></tr></tbody></table>The different CheckboxBehaviorMode indicates whether check boxes are displayed next to the tree nodes in the tree view control and how the tree view handle related events. The main difference between SingleChecked and RecursiveChecked behavior, lies in the fact that the user can't unselect sub folders of a checked folder in RecursiveChecked mode.
<table id="table3" cellspacing="0" class="dtTABLE"><tbody><tr valign="top"><th style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">Member Name</th><th style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">Description</th></tr><tr valign="top"><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**None**</td><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**No check boxes**are displayed next to the tree nodes in the tree view control.</td></tr><tr valign="top"><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**SingleChecked**</td><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**Check boxes**are displayed next to the tree nodes in the tree view control. The user can check directories.</td></tr><tr valign="top"><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**RecursiveChecked**</td><td style="BORDER-RIGHT: #999999 0px solid; PADDING-RIGHT: 6px; BORDER-TOP: #999999 0px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 4px; BORDER-LEFT: #999999 1px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #999999 1px solid; TEXT-ALIGN: left" width="50%">**Check boxes** are displayed next to the tree nodes in the tree view control. The user can check directories, the**subdirectories are checked recursive**.</td></tr></tbody></table>The root folder property let you specify where the browsing starts from. Root folder values are defined bySystem.Environment.SpecialFolder.
The combination ofDriveType,CheckboxBehaviorModes andSpecialFolder enumeration values gives you the ability to control how the tree view display it's content and behaves when you select a directory.
DataProvider
Data providers are the workers behind theTreeViewFolderBrowser which controls them. By implementing theITreeViewFolderBrowserDataProvider interface, you will have full control over the core processes like retrieving data, assign images to the nodes and provide customContextMenu items for each node. But you don't have to care about checkboxes, load on demand, find node at position if the user request theContextMenu, you will be hooked if it's time to take
Related Skills
next
A beautifully designed, floating Pomodoro timer that respects your workspace.
product-manager-skills
34PM skill for Claude Code, Codex, Cursor, and Windsurf: diagnose SaaS metrics, critique PRDs, plan roadmaps, run discovery, and coach PM career transitions.
devplan-mcp-server
3MCP server for generating development plans, project roadmaps, and task breakdowns for Claude Code. Turn project ideas into paint-by-numbers implementation plans.
