BetterFolderBrowser.Core 1.0.0

dotnet add package BetterFolderBrowser.Core --version 1.0.0                
NuGet\Install-Package BetterFolderBrowser.Core -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BetterFolderBrowser.Core" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BetterFolderBrowser.Core --version 1.0.0                
#r "nuget: BetterFolderBrowser.Core, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BetterFolderBrowser.Core as a Cake Addin
#addin nuget:?package=BetterFolderBrowser.Core&version=1.0.0

// Install BetterFolderBrowser.Core as a Cake Tool
#tool nuget:?package=BetterFolderBrowser.Core&version=1.0.0                

BetterFolderBrowser.Core

bfb-nuget

BetterFolderBrowser.Core is a .NET Core 3.1 component library that was written to help developers provide a better folder-browsing and selection experience to users by employing a similar browser dialog as the standard OpenFileDialog in place of the current FolderBrowserDialog which only allows for single-folder selections with its tree-view display format. This allows for a much easier viewing, modification, searching and selection experience using the standard Windows Explorer dialog.

This is a fork of the BetterFolderBrowser by Willy-Kimura. I remade the projects and solution in .NET Core 3.1, but almost all of this work is theirs. Even this ReadMe is borrowed from that repo. Visit and donate there.

Here's a preview of the library in action:

bfb-preview-01 bfb-usage

Installation

To install via the NuGet Package Manager Console, type:

Install-Package BetterFolderBrowser.Core

Features

  • Works with .NET Core 3.1 and above allowing for usability across most .NET Core applications.
  • Built as a component making it accessible in Design Mode.
  • Uses the same dialog model as the OpenFileDialog, making it super easy for users to view, search, select, and modify folders when opened.
  • Allows passing of literal paths as strings to the RootFolder property.
  • Allows folder multi-selection in contrast to the standard WinForms FolderBrowserDialog which only allows for single-folder selections. One can then access the list of selected folders using the property SelectedPaths or its variant SelectedFolers property.
  • The dialog can be displayed either blocking the UI thread or not using the ShowDialog(IWin32Window) or ShowDialog() methods respectively.

Usage

If you prefer working with the Designer, simply add the component to Visual Studio's Toolbox and use the Properties window to change its options:

bfb-properties

To use it in code, first import WK.Libraries.BetterFolderBrowserNS - the code below will then assist you:

    var betterFolderBrowser = new BetterFolderBrowser();

    betterFolderBrowser.Title = "Select folders...";
    betterFolderBrowser.RootFolder = "C:\\";
    
    // Allow multi-selection of folders.
    betterFolderBrowser.Multiselect = true;

    if (betterFolderBrowser.ShowDialog() == DialogResult.OK)
    {
        string[] selectedFolders = betterFolderBrowser1.SelectedFolders;
        
        // If you've disabled multi-selection, use 'SelectedFolder'.
        // string selectedFolder = betterFolderBrowser1.SelectedFolder;
    }

If you'd prefer blocking the main UI thread when calling the dialog, simply specify the window owner of the dialog using the ShowDialog(IWin32Window) method:

    if (betterFolderBrowser.ShowDialog(this) == DialogResult.OK)
    {
        // ...
    }

Note that we've specified the owner with the keyword this since we're calling the dialog from the Form where it is hosted.

If you're calling the dialog from within a custom UserControl and would prefer blocking the main UI thread when calling it, you can still specify the window owner using the ShowDialog(IWin32Window) method:

    if (betterFolderBrowser.ShowDialog(this.FindForm()) == DialogResult.OK)
    {
        // ...
    }

Made with 💛 by Willy Kimura. Upgraded with 💕 by jsmunroe.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 809 4/29/2022