The .NET FolderBrowserDialog class does not have an InitialDirectory property like the OpenFileDialog class.  But fortunately, it’s quite easy to set an initial folder in the FolderBrowserDialog: FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.RootFolder = Environment.SpecialFolder.Desktop; dialog.SelectedPath = @"C:Program Files"; if (dialog.ShowDialog() == DialogResult.OK) { Console.WriteLine( dialog.SelectedPath ); } Note that you can choose other RootFolder’s like MyComputer and MyDocuments.  Related posts: Adding Assemblies to the Visual Studio "Add Reference" Dialog Console Output from a WinForms Application The Proper Way to Show the Wait Cursor

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz