Stopbyte

How to use FolderBrowserDialog equivalent in WPF application?

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

1 Like

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;
}