FolderBrowserDialog SelectedPath and drive D

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alf

    FolderBrowserDialog SelectedPath and drive D

    Hi,

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

    FolderBrowserDi alog folderBrowserDi alog1 = new FolderBrowserDi alog();
    folderBrowserDi alog1.RootFolde r =
    System.Environm ent.SpecialFold er.MyComputer;
    folderBrowserDi alog1.SelectedP ath = "D:\\";
    folderBrowserDi alog1.ShowDialo g();

    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
  • Angel J. Hernández M.

    #2
    Re: FolderBrowserDi alog SelectedPath and drive D

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

    Regards,


    --
    Angel J. Hernández M.
    MCP - MCAD - MCSD - MCDBA




    "alf" <alfboggis@yaho o.co.uk> wrote in message
    news:c228021c.0 502280233.e1d6f 0d@posting.goog le.com...[color=blue]
    > Hi,
    >
    > I am using a FolderBrowserDi alog to allow the user to select a folder
    > as follows:
    >
    > FolderBrowserDi alog folderBrowserDi alog1 = new FolderBrowserDi alog();
    > folderBrowserDi alog1.RootFolde r =
    > System.Environm ent.SpecialFold er.MyComputer;
    > folderBrowserDi alog1.SelectedP ath = "D:\\";
    > folderBrowserDi alog1.ShowDialo g();
    >
    > 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[/color]


    Comment

    Working...