Пример #1
0
        private void btPlus_Click(object sender, EventArgs e)
        {
            PlusForm plusForm = new PlusForm();

            plusForm.Show();

            this.Hide();
        }
Пример #2
0
        private void countRandom()
        {
            PlusForm   plusForm   = new PlusForm();
            MinusForm  minusForm  = new MinusForm();
            DivideForm divideForm = new DivideForm();
            MultiForm  multiForm  = new MultiForm();

            List <string> randomDisplay = new List <string> {
                "Plus", "Minus", "Multiple", "Divide"
            };

            int pick = rand.Next(randomDisplay.Count);

            string picked = randomDisplay[pick];

            if (picked == "Plus")
            {
                lbLeftNum.Text  = plusForm.returnLeftNum(count).ToString();
                Sign            = "+";
                lbSign.Text     = Sign;
                lbRightNum.Text = plusForm.returnRightNum(count).ToString();
            }
            else if (picked == "Minus")
            {
                lbLeftNum.Text  = minusForm.returnLeftNum(count).ToString();
                Sign            = "-";
                lbSign.Text     = Sign;
                lbRightNum.Text = minusForm.returnRightNum(count).ToString();
            }
            else if (picked == "Multiple")
            {
                lbLeftNum.Text  = multiForm.returnLeftNum(count).ToString();
                Sign            = "x";
                lbSign.Text     = Sign;
                lbRightNum.Text = multiForm.returnRightNum(count).ToString();
            }
            else
            {
                lbLeftNum.Text  = divideForm.returnLeftNum().ToString();
                Sign            = "/";
                lbSign.Text     = Sign;
                lbRightNum.Text = divideForm.returnRightNum().ToString();
            }
        }
Пример #3
0
        private void btMenu_Click(object sender, EventArgs e)
        {
            DialogResult result = new DialogResult();

            result = MessageBox.Show("Are You Sure?", "Go Back", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            while (true)
            {
                if (result == DialogResult.OK)
                {
                    PlusForm plusForm = new PlusForm();
                    plusForm.clearData();
                    menu.Show();
                    this.Hide();
                    break;
                }
                else
                {
                    break;
                }
            }
        }
Пример #4
0
        private void PlusFromResult_Load(object sender, EventArgs e)
        {
            PlusForm plusForm = new PlusForm();

            lbShowResults.Text = plusForm.outPutHistory();
        }