private void DivButton_Click(object sender, EventArgs e) // / operation
 {
     if (finish == false)
     {
         EqualButton.PerformClick(); //used to perform multiple calculations
         calc.Divide(Convert.ToDecimal(textBox1.Text));
         finish = true;
     }
     else
     {
         calc.Divide(Convert.ToDecimal(textBox1.Text));
         finish = true;
     }
     operation += textBox1.Text + " / ";
 }
示例#2
0
        private void OperatorButton_Click(object sender, EventArgs e)
        {
            Button op = (Button)sender;

            if (resVal != 0)
            {
                EqualButton.PerformClick();
                showprevoperation  = true;
                operand            = op.Text;
                prevOperation.Text = resVal + " " + operand;
            }

            else
            {
                operand            = op.Text;
                resVal             = Double.Parse(TotalDisplay.Text);
                showprevoperation  = true;
                prevOperation.Text = resVal + " " + operand;
            }
            first_num = prevOperation.Text;
        }