Esempio n. 1
0
        // return:
        //      null    �û�ȡ���Ի���
        //      ����    �������ֵ
        public static string GetInput(
			IWin32Window owner,
			string strDlgTitle,
			string strTitle,
			string strDefaultValue,
            Font font = null)
        {
            InputDlg dlg = new InputDlg();
            if (font != null)
                dlg.Font = font;

            if (strDlgTitle != null)
                dlg.Text = strDlgTitle;

            if (strTitle != null)
                dlg.label_title.Text = strTitle;

            if (strDefaultValue != null)
                dlg.textBox_value.Text = strDefaultValue;

            dlg.StartPosition = FormStartPosition.CenterScreen; // 2008/10/17
            dlg.ShowDialog(owner);

            if (dlg.DialogResult != DialogResult.OK)
                return null;

            return dlg.textBox_value.Text;
        }
Esempio n. 2
0
        // return:
        //      null    用户取消对话框
        //      其他    所输入的值
        public static string GetInput(
            IWin32Window owner,
            string strDlgTitle,
            string strTitle,
            string strDefaultValue,
            string strCheckBoxText,
            ref bool bCheckBox,
            Font font = null)
        {
            InputDlg dlg = new InputDlg();

            if (font != null)
            {
                dlg.Font = font;
            }

            if (strDlgTitle != null)
            {
                dlg.Text = strDlgTitle;
            }

            if (strTitle != null)
            {
                dlg.label_title.Text = strTitle;
            }

            if (strDefaultValue != null)
            {
                dlg.textBox_value.Text = strDefaultValue;
            }

            if (strCheckBoxText == null)
            {
                dlg.CheckBoxVisible = false;
            }
            else
            {
                dlg.CheckBoxVisible = true;
                dlg.CheckBoxText    = strCheckBoxText;
            }

            dlg.CheckBoxValue = bCheckBox;
            dlg.StartPosition = FormStartPosition.CenterScreen; // 2008/10/17

            // 2017/4/6
            if (owner == null)
            {
                dlg.TopMost = true;
            }

            dlg.ShowDialog(owner);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return(null);
            }

            bCheckBox = dlg.CheckBoxValue;
            return(dlg.textBox_value.Text);
        }
Esempio n. 3
0
        // return:
        //      null    用户取消对话框
        //      其他    所输入的值
        public static string GetInput(
            IWin32Window owner,
            string strDlgTitle,
            string strTitle,
            string strDefaultValue,
            Font font = null)
        {
            InputDlg dlg = new InputDlg();

            if (font != null)
            {
                dlg.Font = font;
            }

            if (strDlgTitle != null)
            {
                dlg.Text = strDlgTitle;
            }

            if (strTitle != null)
            {
                dlg.label_title.Text = strTitle;
            }

            if (strDefaultValue != null)
            {
                dlg.textBox_value.Text = strDefaultValue;
            }

            dlg.StartPosition = FormStartPosition.CenterScreen; // 2008/10/17
            dlg.ShowDialog(owner);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return(null);
            }

            return(dlg.textBox_value.Text);
        }