Wednesday, May 23, 2007

Folder Browsing --- Easy way 1

For .Net Framework, use FolderBrowserDialog:

System.Windows.Forms.FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.ShowNewFolderButton = false;
fbd.Description = "Please select a folder.";
fbd.RootFolder = System.Environment.SpecialFolder.DesktopDirectory ;
fbd.SelectedPath = "apps"; //default
if(fbd.ShowDialog()==System.Windows.Forms.DialogResult.OK)
MessageBox.Show(fbd.SelectedPath);

But , this is not available for .net Compact Framework

No comments: