计算器的问题??
private void button1_Click(object sender, EventArgs e){
int m;
textBox1.Text =textBox1.Text+ button1.Text;
m = int.Parse(textBox1.Text);
}
private void button2_Click(object sender, EventArgs e)
{
int m;
textBox1.Text =textBox1.Text+ button2.Text;
m = int.Parse(textBox1.Text);
}
private void button3_Click(object sender, EventArgs e)
{
int m;
textBox1.Text =textBox1.Text+ button3.Text;
m = int.Parse(textBox1.Text);
}
private void button4_Click(object sender, EventArgs e)
{
int m;
textBox1.Text =textBox1.Text+ button4.Text;
m = int.Parse(textBox1.Text);
}
private void button5_Click(object sender, EventArgs e)
{
int m;
textBox1.Text =textBox1.Text+ button5.Text;
m = int.Parse(textBox1.Text);
}
private void button6_Click(object sender, EventArgs e)
{
int m;
textBox1.Text = textBox1.Text + button6.Text;
m = int.Parse(textBox1.Text);
}
private void button7_Click(object sender, EventArgs e)
{
int m;
textBox1.Text = textBox1.Text + button7.Text;
m = int.Parse(textBox1.Text);
}
private void button8_Click(object sender, EventArgs e)
{
int m;
textBox1.Text = textBox1.Text + button8.Text;
m = int.Parse(textBox1.Text);
}
private void button9_Click(object sender, EventArgs e)
{
int m;
textBox1.Text = textBox1.Text + button9.Text;
m = int.Parse(textBox1.Text);
}
private void button10_Click(object sender, EventArgs e) //以上是一到十的控件
{
int m;
textBox1.Text = textBox1.Text + button10.Text;
m = int.Parse(textBox1.Text);
}
private void button11_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + button11.Text;
}
private void button12_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + button12.Text;
}
private void button13_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + button13.Text;
}
private void button15_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text + button15.Text;
}
private void button16_Click(object sender, EventArgs e) //以上是加减乘除的控件
{
textBox1.Text = textBox1.Text + button16.Text;
}
private void button14_Click(object sender, EventArgs e) //等号的控件
{
int n;
n=(int.Parse(textBox1.Text))-(int.Parse(textBox1.Text));
textBox1.Text =Convert.ToString(n);
}
private void button17_Click(object sender, EventArgs e)
{
textBox1.Text = "";//清除文本框的内容
}
}
}
我想做一个计算器的编程(窗体),我只会以上的代码 接下来就不会。求完整的答案,给我参考一下。