473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

FolderBrowserDialog SelectedPath and drive D

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
Nov 16 '05 #1
1 14413
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,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda

"alf" <al*******@yahoo.co.uk> wrote in message
news:c2*************************@posting.google.co m...
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

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: | last post by:
Hi, The following code shows the FolderBrowserDialog = broken. FolderBrowserDialog folderDialog = new FolderBrowserDialog(); folderDialog.ShowNewFolderButton = false;...
0
by: Derrick | last post by:
If I have code... FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.RootFolder = Environment.SpecialFolder.MyComputer; fbd.SelectedPath = "C:\\Documents and Settings\\theCurrentUser"...
4
by: MikeY | last post by:
Hi Everyone, I'm getting stumped here. I've been trying to use the FolderBrowserDialog for the first time, but to no avail. Can someone please give me adive on how to use this. I don't know if I...
0
by: Alpha | last post by:
My FolderBrowserDialog shows just the description on the top then 3 buttons (OK, Cancel, NewFolder) at the buttom of the dialog. It doesn't desplay the directory tree. I even specified not to...
3
by: antuantuan | last post by:
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...
11
by: Grumpy Aero Guy | last post by:
I have created an app that makes use of the FolderBrowserDialog. Upon building the app, installing and running it, and invoking the form using the dialog, it hangs upon folder selection and goes...
0
by: Gerrit | last post by:
Hello all, I have code to select a folder, see below. My question is: When the FolderBrowser opens, then my My music folder is at the bottom of the browser, and closed. Is it possible to...
6
by: chrisknapp | last post by:
I'm learning VB and am making an application where I need a user to be able to choose which folder his files are located in. The folder path chosen will be stored as a string for later use in the...
3
by: ImageAnalyst | last post by:
I'm trying to have the user browse to a folder, once they click a button, using the standard FolderBrowserDialog tool, System.Windows.Forms.FolderBrowserDialog. I'm using VB.Net 2005. There is a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.