FolderBrowserDialog SelectedPath and drive D

A

alf

Hi,

I am using a FolderBrowserDialog to allow the user to select a folder
as follows:

FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
folderBrowserDialog1.RootFolder =
System.Environment.SpecialFolder.MyComputer;
folderBrowserDialog1.SelectedPath = "D:\\";
folderBrowserDialog1.ShowDialog();

I want the dialog to come up with Local Disk(D:) selected, but instead
just My Computer is selected, though D: appears in the list.

If I replace "D:\\" with "C:\\", "E:\\" or "F:\\" it gets selected OK,
it's just drive D that it doesn't like. I can select drive D in the
dialog, and ShowDialog() returns with SelectedPath set to "D:\\"
correctly.

C:\ and D:\ are local hard drives, E:\ is a DVD-ROM and F:\ is a USB
flash card.

I hope someone here can help me, I can't understand what is going on.

Thanks,

A
 
A

Angel J. Hernández M.

Hi there... you should not specify both the RootFolder and the SelectedPath
properties on the
same FolderBrowserDialog control. Try this not setting the rootfolder
property,

Regards,
 

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