Choosing a customized RootFolder in a FolderBrowserDialog

  • Thread starter Thread starter antuantuan
  • Start date Start date
A

antuantuan

Hi.

How can I initialize a FolderBrowserDialog choosing a particular RootFolder?
I saw that FolderBrowserDialog has a RootFolder member, but it accepts only
an Environment.SpecialFolder (but I don't want to choose a SpecialFolder for
my FolderBrowserDialog).

I hope I've been clear.

Thanks in advance
 
Set the FolderBrowserDialog.SelectedPath value before showing the dialog.
Here's the first line from the Remarks section in the SDK for SelectPath:

"If the SelectedPath property is set before showing the dialog box, the
folder with this path will be the selected folder, as long as SelectedPath
is set to an absolute path that is a subfolder of RootFolder (or more
accurately, points to a subfolder of the shell namespace represented by
RootFolder)."
 
Pete said:
Set the FolderBrowserDialog.SelectedPath value before showing the
dialog. Here's the first line from the Remarks section in the SDK for
SelectPath:

I already did that and when the dialog is shown, the path I set is correctly
selected (highlighted) but it's not the root folder of the dialog (that is
what I want, in other words I want to see only the dir I chose and its
subdir's).
 
Back
Top