14

Is there an alternative for selecting folders in C#?

Optimally I'd like to use the OpenFileDialog to select folders, or at least something similar to that.

Filburt
  • 16,951
  • 12
  • 63
  • 111
NMunro
  • 1,242
  • 4
  • 18
  • 32
  • You want an alternative to the FolderBrowserDialog that is built into Winforms, but when given two alternatives, you state that you want something built-in.. – Tergiver Sep 17 '12 at 17:39
  • **[Ookii Dialogs](https://github.com/ookii-dialogs)** libraries have an implementation of a folder browser dialog for Windows Forms and WPF – C. Augusto Proiete Oct 20 '18 at 21:42

4 Answers4

8

Here you have and OpenFileOrFolder dialog and here another FolderBrowserDialog both Open Source.

Erre Efe
  • 15,194
  • 10
  • 43
  • 74
  • 1
    That Ookii dialog works really well. Just curious, but is there any non-third alternatives to FolderBrowserDialog? I was hoping there would be a moderately easy way of having an OpenFileDialog that allows you to select folders. – NMunro Sep 17 '12 at 14:57
  • 1
    @NMunro Nop. The BCL doesn't provide you with other alternative. But implemented third-party ones isn't as hard as it seems. – Erre Efe Sep 17 '12 at 15:13
  • I already got the implementation to work with Ookii, but I'd prefer not to use a 3rd party app. – NMunro Sep 17 '12 at 17:36
3

Ookii Dialogs libraries have an implementation of a folder browser dialog for Windows Forms and WPF

Ookii Folder Browser Dialog

Ookii.Dialogs.WinForms

https://github.com/augustoproiete/ookii-dialogs-winforms


Ookii.Dialogs.Wpf

https://github.com/augustoproiete/ookii-dialogs-wpf

C. Augusto Proiete
  • 20,243
  • 2
  • 51
  • 71
3

For this very reason I developed BetterFolderBrowser. It's a .NET library does just what you need by providing an easy-to-use folder browsing experience that mimics the OpenFileDialog dialog window. Also, since it works as a component, you'll be able to easily tweak its properties in Design Mode. Hope it helps.

Willy Kimura
  • 281
  • 2
  • 5
1

The closest I found myself to what you may want is this:

http://www.codeproject.com/Articles/15059/C-File-Browser

This is a control that you can place on a dialog (form). It allows selecting files or folders. Here is what my implementation looks like:

enter image description here

Alex Mendez
  • 5,028
  • 1
  • 24
  • 23
  • The Ookii dialog that was posted earlier is almost exactly what I want. It's essentially the openfiledialog, but for folders. Only I'd prefer not to use a third party app. – NMunro Sep 17 '12 at 15:09