FolderBrowserDialog - SelectedPath

D

Derrick

If I have code...

FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.RootFolder = Environment.SpecialFolder.MyComputer;
fbd.SelectedPath = "C:\\Documents and Settings\\theCurrentUser"
fbd.Description = "Select a Directory";
if(fbd.ShowDialog()==DialogResult.OK)
{
...

The folder browser comes up, my computer as root, directory C:\\Documents
and Settings\\theCurrentUser as the currently selected path.

However, if i change the selected path to the below before showing, adding
My Documents to the path..

fbd.SelectedPath = "C:\\Documents and
Settings\\theCurrentUser\\My Documents"

The dialog comes up, no folders opened, my computer as the selected node in
the directory tree.

?

Derrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top