0

I'm using the FolderBrowserDialog class to allow a user to select a directory however if they want to create a director, I only want to allow it to be created under a specific directory. Can this be done with this class? my current code looks like this:

FolderBrowserDialog diag = new FolderBrowserDialog();
     diag.SelectedPath = PubVars.locVault;
     diag.ShowNewFolderButton = true;
     DialogResult results = diag.ShowDialog();
     if (results.Equals(DialogResult.OK))
     {
        lblNewVault.Text = diag.SelectedPath;
        Environment.SpecialFolder rootFolder = diag.RootFolder;
     }

Thanks for the help.

Bob Gatto
  • 131
  • 8
  • AFAIK No, FolderBrowserDialog is so minimal that is pretty impossible to use it for something different from what has been (poorly) designed – Steve Apr 14 '16 at 19:53
  • Is there another class or API that would allow me to do what I'm looking for? – Bob Gatto Apr 14 '16 at 20:26
  • None that I know of. Of course using the Windows API anything is possible, but with the NET libraries I am not aware of anything that could do what you require. [There are alternatives to FolderBrowserDialog](http://stackoverflow.com/questions/12461016/alternative-to-folderbrowserdialog) but they don't solve your requirements – Steve Apr 14 '16 at 20:33

0 Answers0