How to use FolderBrowserDialog equivalent in WPF application?


(isoftech) #1

i am new to WPF and need to use something similar to FolderBrowserDialog as in Windows Forms, is there any equivalent in WPF? or what should i do to allow the user to select a folder.

thanks


(Kunni Can) #2

It is almost similar to Windows Forms, here is a code snippet:

String folderName="";
FolderBrowserDialog dialog = new FolderBrowserDialog();
DialogResult res = dialog.ShowDialog();
if (res == DialogResult.OK)
{
    folderName = diag.SelectedPath;
}