tags:

views:

572

answers:

3

In visual studio 2008 there is a folder browser dialog that looks like this(very similar to file open dialog): http://img24.imageshack.us/img24/5742/folderbrowser.jpg

Does anyone know how to invoke it from code?

A: 

Drag a FolderBrowserDialog component from the Dialogs tab of the Toolbox to the form. Add this code to you button handler.

if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
        {
            this.label1.Text = folderBrowserDialog1.SelectedPath;
        }
Sorantis
Please look at the attached image. I want THAT folder browser dialog and not the regular ugly one.
Alex Reitbort
+1  A: 

Is this the pinvoke of SHBrowseForFolder, with the BIF_NEWDIALOGSTYLE style? If so there is an example on that page.

Preet Sangha
+1  A: 

At the end I just used the VistaBridge library to open it.

Alex Reitbort