Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            MinusForm minusForm = new MinusForm();

            minusForm.Show();
            this.Hide();
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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)
                {
                    MinusForm minusForm = new MinusForm();
                    minusForm.clearData();
                    menu.Show();
                    this.Hide();
                    break;
                }
                else
                {
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        private void MinusFormResult_Load(object sender, EventArgs e)
        {
            MinusForm minusForm = new MinusForm();

            lbShowResults.Text = minusForm.outPutHistory();
        }