Example #1
0
        /// <summary>
        /// 弹出(扩展的)选择目录对话框,选择目录后返回所选的目录路径,未选择时返回null
        /// <para>(实际弹出的是:修改后的只能选择文件夹的打开文件对话框)</para>
        /// </summary>
        /// <param name="selectPath">初始目录路径</param>
        /// <param name="description">描述</param>
        /// <returns></returns>
        public static string ShowFolderBrowserDialogEx(string selectPath = null, string description = null)
        {
            //var dialog = new PathFolderBrowserDialog(selectPath, description, showNewFolderButton);
            var dialog = new WLib.WinCtrls.ExplorerCtrl.FileFolderCtrl.FolderBrowserDialog
            {
                SelectedPath = selectPath,
                Desrciption  = description
            };

            return(dialog.ShowDialog() == DialogResult.OK ? dialog.SelectedPath : null);
        }
Example #2
0
        private void 测试ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();

            dlg.ShowDialog(this);
        }