Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 4.53 KB

File metadata and controls

58 lines (40 loc) · 4.53 KB

WinForms Breadcrumb Editor - Create a folder navigation bar (File Explorer)

This example demonstrates how to use the WinForms Breadcrumb Editor to create a folder navigation bar inspired by Microsoft Windows File Explorer.

WinForms Breadcrumb Editor - Create a folder navigation bar

Two root nodes ('Root' and 'Computer') are created at design time. Their BreadCrumbNode.Persistent and BreadCrumbNode.PopulateOnDemand properties are set to true. The Root node stores shortcuts to most important directories (Desktop, Windows, Program Files). The Computer node allows users to quickly navigate through local disks via related shortcuts.

void InitBreadCrumbRootNode(BreadCrumbNode node) {
    node.ChildNodes.Add(new BreadCrumbNode("Desktop", Environment.GetFolderPath(Environment.SpecialFolder.Desktop)));
    node.ChildNodes.Add(new BreadCrumbNode("Windows", Environment.GetFolderPath(Environment.SpecialFolder.Windows)));
    node.ChildNodes.Add(new BreadCrumbNode("Program Files", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)));
}
void InitBreadCrumbComputerNode(BreadCrumbNode node) {
    foreach (DriveInfo driveInfo in GetFixedDrives()) {
        node.ChildNodes.Add(new BreadCrumbNode(driveInfo.Name, driveInfo.RootDirectory));
    }
}

The following events are handled to dynamically generate the Nodes tree according to the folder structure:

Files to Review

Documentation

See Also

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)