0

I need a control like SaveFileDialog that lets me choose a directory instead of a file. It should also let me specify the directory by pasting text. SaveFileDialog does not allow this.

I have tried FolderBrowserDialog, but it does not meet my requirements because it does not support pasting the directory path as text. Some of the directory I'm working with may be nested 10 levels or more, so being forced to navigate via point-and-click is not enough.

Thanks in advance.

InvalidBrainException
  • 2,312
  • 8
  • 32
  • 41

2 Answers2

2

AFAK there is no built-in control in windows for doing such thing. You have do it yourself using a treeview control and iterating through all your nested folders

here A Simple WPF Explorer Tree you can find an example on how you can do this

BRAHIM Kamel
  • 13,492
  • 1
  • 36
  • 47
2

FolderBrowserDialog itself may not support this, but it's a thin wrapper around a shell function that does support it. The SHBrowseForFolder function's BROWSEINFO parameter has a flag BIF_EDITBOX that does what you want.

You could choose to use SHBrowseForFolder directly, or you could use a different pre-made managed wrapper around it, such as FolderBrowserDialogEx.