Folder Browser Dialog
-
Hi All! How can we get the 'Folder Browser Dialog' like ,we have have standard 'file open dialog'. Is there any component in .net providing this capability? or is there some APi, we have to use in order to open a folder browser dialog.? Thanx in Advance :) sorry for my bad English.
-
Hi All! How can we get the 'Folder Browser Dialog' like ,we have have standard 'file open dialog'. Is there any component in .net providing this capability? or is there some APi, we have to use in order to open a folder browser dialog.? Thanx in Advance :) sorry for my bad English.
try this one, it have some limited. Add System.Design into References. Use method ShowDialog() to show using System; using System.Windows.Forms; using System.Windows.Forms.Design; namespace WindowsApplication1 { /// /// this provides the BrowseFolderDialog for browse folders. /// public class BrowseFolderDialog : FolderNameEditor { FolderNameEditor.FolderBrowser fBrowser; public BrowseFolderDialog() { fBrowser = new FolderNameEditor.FolderBrowser(); } public string DirectoryPath { get {return fBrowser.DirectoryPath;} } public DialogResult ShowDialog(string txtDescription) { // set the Description label fBrowser.Description = txtDescription; fBrowser.StartLocation = FolderBrowserFolder.MyDocuments; return fBrowser.ShowDialog(); } ~BrowseFolderDialog() { // destructor fBrowser.Dispose(); } } }
-
Hi All! How can we get the 'Folder Browser Dialog' like ,we have have standard 'file open dialog'. Is there any component in .net providing this capability? or is there some APi, we have to use in order to open a folder browser dialog.? Thanx in Advance :) sorry for my bad English.
There is
System.Windows.Forms.FolderBrowserDialog
in .NET 1.1 and up. For applications targeting .NET 1.0, you'll have to create a look-alike or encapsulate theSHBrowserForFolder
API. There are several articles here on the CodeProejct site that discuss the latter option. The component I mentioned first is very easy to use, just like theOpenFileDialog
andSaveFileDialog
components.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----