BrowseForFolder class
More code from me shwoing the .NET way to do common things that used to require mucho API.. This is a BrowseForFolder class that uses the .NET framework only... Havent seen this done yet without API. Enjoy..and please vote if you like it and use it.
AI
Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Zdrojový kód
// created on 04/11/2002 at 6:29 PM
// by Chris Andersen using SharpDevelop http://www.icsharpcode.net
// This class give you the BrowseForfolder dialog without using the API.
// Sample usage
/* BrowseForFolder test = new BrowseForFolder();
MessageBox.Show(test.ShowIt("bwah"));
*/
using System;
using System.Windows.Forms;
using System.Windows.Forms.Design;
public class BrowseForFolder : FolderNameEditor
{
// inherit the FolderNameEditor class
FolderNameEditor.FolderBrowser fBrowser;
public BrowseForFolder()
{
// contructor
// create an instance of FolderBrowser
fBrowser = new System.Windows.Forms.Design.FolderNameEditor.FolderBrowser();
}
public string ShowIt(string textdescription)
{
// set the Description label
fBrowser.Description = textdescription;
fBrowser.ShowDialog(); // show the Windows
return fBrowser.DirectoryPath; // return whatever path choosen
}
~BrowseForFolder()
{
// destructor
fBrowser.Dispose();
}
}
Původní komentáře (3)
Obnoveno z Wayback Machine