目前的问题是计算器无法连续计算,如:3+5+2在程序中结果为7,如何实现连续计算
下面是=号的代码
if (type == "+")
{
textBox1.Text = (x + y).ToString();
textBox2.Text += "=" + textBox1.Text;
}
if (type == "-")
{
textBox1.Text = (x - y).ToString();
textBox2.Text += "=" + textBox1.Text;
}
if (type == "×")
{
textBox1.Text = (x * y).ToString();
textBox2.Text += "=" + textBox1.Text;
}
if (type == "÷")
{
textBox1.Text = (x / y).ToString();
textBox2.Text += "=" + textBox1.Text;
}
if (type == "%")
{
textBox1.Text = (x % y).ToString();
textBox2.Text += "=" + textBox1.Text;
}