ExFolderBrowserDialog
ExFolderBrowserDialog shows the folder dialog of Windows Vista and newer (the Explorer-style file dialog in folder mode)
in .NET Framework 4.8, where FolderBrowserDialog shows the old tree dialog. It exists only in the .NET Framework build of
the library: in .NET, FolderBrowserDialog already uses the new dialog.
using var dialog = new ExFolderBrowserDialog
{
Description = "Choose the output folder",
InitialDirectory = settings.OutputFolder
};
if (dialog.ShowDialog(this) == DialogResult.OK)
settings.OutputFolder = dialog.SelectedPath;
| Property | Description |
|---|---|
InitialDirectory |
Folder shown when the dialog opens, the current directory by default. |
Description |
Title of the new dialog, text above the folders of the old one. |
SelectedPath |
The folder the user picked. |
RootFolder, ShowNewFolderButton |
Used only by the old tree dialog, which is the fallback where the new one isn't available. |
A project that targets both frameworks can choose the dialog in code:
#if NETFRAMEWORK
using var dialog = new ExFolderBrowserDialog();
#else
using var dialog = new FolderBrowserDialog();
#endif
The API reference on this website is generated from the .NET build, so it doesn't list this class.