Exemplo n.º 1
0
        public static bool ShowInputNum(string msg, string lbltext, out int inputNum, double maxnum)
        {
            frmInputNum frm = new frmInputNum();

            frm.lblMsg.Text     = msg;
            frm.maxnum          = maxnum;
            frm.label1.Text     = lbltext;
            frm.button1.Left    = frm.button2.Left;
            frm.button2.Visible = false;
            if (msg.IndexOf("退") > 0)
            {
                frm.label1.ForeColor = Color.Red;
            }
            frm.ShowDialog();
            bool ret = frm.DialogResult == DialogResult.OK;

            if (ret)
            {
                inputNum = int.Parse(frm.tbxNum.Text);
            }
            else
            {
                inputNum = 0;
            }
            return(ret);
        }
Exemplo n.º 2
0
        public static bool ShowInputNum(string msg, out int inputNum, int maxnum)
        {
            frmInputNum frm = new frmInputNum();

            frm.lblMsg.Text     = msg;
            frm.maxnum          = maxnum;
            frm.button1.Left    = frm.button2.Left;
            frm.button2.Visible = false;
            frm.ShowDialog();
            bool ret = frm.DialogResult == DialogResult.OK;

            if (ret)
            {
                inputNum = int.Parse(frm.tbxNum.Text);
            }
            else
            {
                inputNum = 0;
            }
            return(ret);
        }