Hi there,
First add a reference to System.Design.d ll and then the following code
should work:
using System;
using System.Windows. Forms;
using System.Windows. Forms.Design;
public class BrowseForFolder : FolderNameEdito r
{
FolderNameEdito r.FolderBrowser bDialog;
public BrowseForFolder ()
{
bDialog = new FolderNameEdito r.FolderBrowser ();
}
public string browseDialog(st ring sTitle)
{
bDialog.Descrip tion = sTitle;
bDialog.StartLo cation =
FolderNameEdito r.FolderBrowser Folder.MyComput er;
bDialog.Style = FolderNameEdito r.FolderBrowser Styles.Restrict ToDomain;
bDialog.ShowDia log();
return bDialog.Directo ryPath;
}
~BrowseForFolde r()
{
bDialog.Dispose ();
}
}
This code is from here:
http://www.planet-source-code.com/vb...odeId=275&lngW
Id=10
The article says you can call the code like so:
BrowseForFolder myDialog = new BrowseForFolder ();
MessageBox.Show (myDialog.brows eDialog("Dialog Title Goes Here");
But if you want to be able to determine what the user pressed, you can do
something like the following:
DialogResult result = myDialog.ShowDi alog()
You can find more about the DialogResult at:
http://msdn.microsoft.com/library/de...s/cpref/html/f
rlrfsystemwindo wsformsdialogre sultclasstopic. asp
Good luck!
Mack D. Male
MVP Visual Developer - Academic
"C# newbie" <rs****@otxrese arch.com> wrote in message
news:#g******** ******@TK2MSFTN GP12.phx.gbl...
Hello,
using openfiledialog, how can I retrieve the path ?
thx