Ejemplo n.º 1
0
 private void Divbutton_Click(object sender, EventArgs e)
 {
     if (calculating)
     {
         ResultButton.PerformClick();
     }
     operation   = 4;
     num1        = Convert.ToDouble(currentNum);
     currentNum  = "";
     calculating = true;
 }
Ejemplo n.º 2
0
        private void OperatorClick(object sender, EventArgs e)
        {
            Button button = (Button)sender;

            if (resultCalculator != 0)
            {
                ResultButton.PerformClick();
                operatorPerformed   = button.Text;
                labelCurrentOp.Text = resultCalculator + " " + operatorPerformed;
                isOperatorPerformed = true;
            }
            else
            {
                operatorPerformed   = button.Text;
                resultCalculator    = double.Parse(textBoxResult.Text);
                labelCurrentOp.Text = resultCalculator + " " + operatorPerformed;
                isOperatorPerformed = true;
            }
        }