计算器
设计界面
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200504181257845.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDAyMjM2NQ==,size_16,color_FFFFFF,t_70#pic_center)
代码
private void Form1_Load(object sender, EventArgs e)
{
this.Left = Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2;
this.Top = Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2;
}
bool xc = false;
private void button1_Click(object sender, EventArgs e)
{
if (xc == true)
{
xc = false;
textBox1.Text = "";
textBox2.Text = "";
}
textBox1.Text += button1.Text;
textBox2.Text += button1.Text;
}
private void button2_Click(object sender, EventArgs e)
{
if (xc == true)
{
xc = false;
textBox1.Text = "";
textBox2.Text = "";
}
textBox1.Text += button2.Text;
textBox2.Text += button2.Text;
}
private void button3_Click(object sender, EventArgs e)
{
if (xc == true)
{
xc = false;
textBox1.Text = "";
textBox2.Text = "";
}
textBox1.Text += button3.Text;
textBox2.Text += button3.Text;
}
private void button4_Click(object sender, EventArgs e)
{
if (xc ==