本文整理汇总了C#中FolderBrowserDialog.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# FolderBrowserDialog.ShowDialog方法的具体用法?C# FolderBrowserDialog.ShowDialog怎么用?C# FolderBrowserDialog.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FolderBrowserDialog
的用法示例。
在下文中一共展示了FolderBrowserDialog.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Click_1
private void Button_Click_1(object sender, RoutedEventArgs e)
{
FolderBrowserDialog ofd = new FolderBrowserDialog();
DialogResult result = ofd.ShowDialog();
if (result == DialogResult.OK)
{
baseDirectoryName = ofd.SelectedPath;
baseDirectoryLabel.Content = baseDirectoryName;
}
}
示例2: GetManualInstallationPath
private static bool GetManualInstallationPath(out string installationPath)
{
string gnomoriaPath = "";
installationPath = null;
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
}
while (!File.Exists(gnomoriaPath))
{
using (FolderBrowserDialog fbd = new FolderBrowserDialog
{
Description = "Gnomoria installation folder (containing Gnomoria.exe)",
ShowNewFolderButton = false
})
{
if (fbd.ShowDialog() != DialogResult.OK)
{
return false;
}
installationPath = Settings.Default.GnomoriaInstallationPath = fbd.SelectedPath;
gnomoriaPath = Path.Combine(installationPath, Reference.OriginalExecutable);
}
Settings.Default.Save();
}
return true;
}
示例3: linkLabel1_LinkClicked_1
private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
{
FolderBrowserDialog fd = new FolderBrowserDialog();
fd.Description = "Select a `parent' folder of projects.\r\nRepository folders are located under the folder you select via this window.";
fd.SelectedPath = parent.basepath;
if (fd.ShowDialog() == DialogResult.OK)
{
/*GitJobParameters p = new GitJobParameters();
p.dir = parent.curdir;
p.toadd = parent.toadd;
p.tochange = parent.tochange;
p.toremove = parent.toremove;*/
parent.jobman.ExecuteAllJobs();
//parent.git.StartCommitChanges(p);
parent.basepath = fd.SelectedPath;
if (parent.basepath.Substring(parent.basepath.Length - 1) != "\\")
parent.basepath += "\\";
parent.fsw.Path = parent.basepath;
this.textBox1.Text = parent.basepath;
parent.jobman = new JobManager(parent, parent.basepath);
parent.RefreshList();
}
}
示例4: cmdBrowse_Click
private void cmdBrowse_Click( object sender, EventArgs e ) {
FolderBrowserDialog dlg = new FolderBrowserDialog();
DialogResult res = dlg.ShowDialog();
if( res == System.Windows.Forms.DialogResult.OK ) {
txtPath.Text = dlg.SelectedPath;
}
}
示例5: MenuItemCallback
/// <summary>
/// This function is the callback used to execute a command when the a menu item is clicked.
/// See the Initialize method to see how the menu item is associated to this function using
/// the OleMenuCommandService service and the MenuCommand class.
/// </summary>
private void MenuItemCallback(object sender, EventArgs e)
{
//MessageBox.Show("Not finished yet.");
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.SelectedPath = "D:/";
if (fbd.ShowDialog() == DialogResult.OK)
{
ImageCatchManager.Instance.SetDirPath(fbd.SelectedPath);
}
//// Show a Message Box to prove we were here
//IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
//Guid clsid = Guid.Empty;
//int result;
//Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
// 0,
// ref clsid,
// "VSBackGroundPackage",
// string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.ToString()),
// string.Empty,
// 0,
// OLEMSGBUTTON.OLEMSGBUTTON_OK,
// OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
// OLEMSGICON.OLEMSGICON_INFO,
// 0, // false
// out result));
}
示例6: OnClicked
void OnClicked(object sender, ToolBarButtonClickEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog(this) == DialogResult.OK) {
statusbar.Text = dialog.SelectedPath;
}
}
示例7: ShowDialog
internal DialogResult ShowDialog(IWin32Window owner)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
DialogResult result = dialog.ShowDialog();
Folder = dialog.SelectedPath;
dialog.Dispose();
return result;
}
示例8: button3_Click
private void button3_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog openFolderDlg = new FolderBrowserDialog();
openFolderDlg.ShowDialog();
if (openFolderDlg.SelectedPath != string.Empty)
outputpath = openFolderDlg.SelectedPath;
this.textBox2.Text = outputpath;
}
示例9: Execute
public void Execute(CoroutineExecutionContext context)
{
var dialog = new FolderBrowserDialog();
if(!String.IsNullOrEmpty(SelectedFolder))
dialog.SelectedPath = SelectedFolder;
var result = dialog.ShowDialog();
SelectedFolder = dialog.SelectedPath;
Completed(this, new ResultCompletionEventArgs { WasCancelled = result != DialogResult.OK });
}
示例10: btnBrowseForFolder_Click
private void btnBrowseForFolder_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Select a folder for saving this file ";
if (fbd.ShowDialog() == DialogResult.OK)
{
txtCurrentLocation.Text = fbd.SelectedPath;
}
}
示例11: OnClickCDsBrowse
private void OnClickCDsBrowse(object sender, EventArgs e)
{
var d = new FolderBrowserDialog();
d.Description = "Select the folder that does (or will) contain your local copy of the CD images archive:";
d.SelectedPath = CdImagesFolderBox.Text;
d.ShowNewFolderButton = true;
d.ShowDialog();
CdImagesFolderBox.Text = d.SelectedPath;
}
示例12: buttonOpen_Click
private void buttonOpen_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.SelectedPath = textBoxWebClientPath.Text;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBoxWebClientPath.Text = dialog.SelectedPath;
}
}
示例13: OnClickMasterInstallerBrowse
private void OnClickMasterInstallerBrowse(object sender, EventArgs e)
{
var d = new FolderBrowserDialog();
d.Description = "Select the folder that contains your local copy of the Master Installer source files:";
d.SelectedPath = MasterInstallerFolderBox.Text;
d.ShowNewFolderButton = false;
d.ShowDialog();
MasterInstallerFolderBox.Text = d.SelectedPath;
}
示例14: btnEditFolder_ButtonClick
private void btnEditFolder_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
FolderBrowserDialog folder = new FolderBrowserDialog();
DialogResult result = folder.ShowDialog();
if (result == DialogResult.OK)
{
btnEditFolder.Text = folder.SelectedPath;
}
}
示例15: btnBrowseDir_Click
private void btnBrowseDir_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog {
Description = "Select the directory containing PCSX2"
};
if (dialog.ShowDialog() == DialogResult.OK)
{
this.tbPcsx2Dir.Text = dialog.SelectedPath;
}
}