Search This Blog

Friday, July 11, 2008

Using FolderBrowserDialog

Setting Intitial Directory:
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.SelectedPath = Settings.Default.IntialFolder;


What button was pushed:
dlg.ShowDialog() == DialogResult.OK

Using:

FolderBrowserDialog dlg = new FolderBrowserDialog();
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.SelectedPath = Settings.Default.IntialFolder;
if ((dlg.ShowDialog() == DialogResult.OK)
{
\\ Some code
}

No comments: