Better folder browser dialog in WinForms

The FolderBrowserDialog provided by .NET is just plain bad, the one that comes standard with Vista/7 is so much better..

So, download Windows API Code Pack, and then

using Microsoft.WindowsAPICodePack.Dialogs;

and

using (Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog folderDialog = new Microsoft.WindowsAPICodePack.Dialogs.CommonOpenFileDialog())
{
 folderDialog.IsFolderPicker = true;
 if (folderDialog.ShowDialog() == CommonFileDialogResult.Ok)

 {
     string folder = folderDialog.FileName;
 }
}

This will give you a dialog like this:

Leave a Reply

Your email address will not be published. Required fields are marked *