当前位置: 首页>>代码示例>>C#>>正文


C# FolderBrowserDialog.ShowDialog方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:blargism,项目名称:DevServiceManager,代码行数:11,代码来源:AddPage.xaml.cs

示例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;
        }
开发者ID:Gnomodia,项目名称:Gnomodia,代码行数:28,代码来源:Program.cs

示例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();
            }
        }
开发者ID:HToyokawa,项目名称:AutoGitClient,代码行数:26,代码来源:Form1.cs

示例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;
     }
 }
开发者ID:BenjaTheGamer,项目名称:depressurizer,代码行数:7,代码来源:DlgSteamPath.cs

示例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));
        }
开发者ID:niuboren,项目名称:TestVSBackGround,代码行数:32,代码来源:VSBackGroundPackagePackage.cs

示例6: OnClicked

    void OnClicked(object sender, ToolBarButtonClickEventArgs e)
    {
        FolderBrowserDialog dialog = new FolderBrowserDialog();

           if (dialog.ShowDialog(this) == DialogResult.OK) {
           statusbar.Text = dialog.SelectedPath;
           }
    }
开发者ID:sciruela,项目名称:MonoWinformsTutorial,代码行数:8,代码来源:Main.cs

示例7: ShowDialog

 internal DialogResult ShowDialog(IWin32Window owner)
 {
     FolderBrowserDialog dialog = new FolderBrowserDialog();
     DialogResult result = dialog.ShowDialog();
     Folder = dialog.SelectedPath;
     dialog.Dispose();
     return result;
 }
开发者ID:Knightshade,项目名称:4Hud,代码行数:8,代码来源:OpenFolderDialog.cs

示例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;
 }
开发者ID:silibili,项目名称:Clustering-Algorithm-in-csharp,代码行数:8,代码来源:MainWindow.xaml.cs

示例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 });
 }
开发者ID:mcdudr01,项目名称:CECS550CShell,代码行数:9,代码来源:ShowFolderDialogResult.cs

示例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;
     }
 }
开发者ID:Disclosure,项目名称:PasteAsFile,代码行数:9,代码来源:frmMain.cs

示例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;
 }
开发者ID:sillsdev,项目名称:masterinstaller,代码行数:9,代码来源:InitUtils.cs

示例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;
     }
 }
开发者ID:san90279,项目名称:UK_OAS,代码行数:9,代码来源:FormInitial.cs

示例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;
 }
开发者ID:sillsdev,项目名称:masterinstaller,代码行数:9,代码来源:InitUtils.cs

示例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;
     }
 }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-facility,代码行数:9,代码来源:AutoBackup.cs

示例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;
     }
 }
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:10,代码来源:wndSettings.cs


注:本文中的FolderBrowserDialog.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。