Results 1 to 4 of 4

Thread: [2005] folderbrowserdialog use custom rootfolder

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    [2005] folderbrowserdialog use custom rootfolder

    is there are way to specify a different rootfolder other than from the list proposed...???

  2. #2
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    Re: [2005] folderbrowserdialog use custom rootfolder

    Quote Originally Posted by lplover2k
    is there are way to specify a different rootfolder other than from the list proposed...???
    isn't that in the properties of the folderbrowserdialog? If you set the initial directory to D:/, wouldn't it be the D:/, rather than whatever it is before?

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] folderbrowserdialog use custom rootfolder

    yes, but only special folders. You can see the different special folder options you can pick by looking at the intellisense enumeration when writing the code.

    for example, this will make the root the windows system folder.
    VB Code:
    1. FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.System

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] folderbrowserdialog use custom rootfolder

    The SelectedPath property is type String and can thus be set to any path. The RootFolder property is type SpecialFolder so, as kleinma says, can only be set to one of the SpecialFolder values. SpecialFolder is an enumeration so you cannot just substitute any old path string for one of its values.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width