private void button11_Click(object sender,EventArgs e)
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/24 22:04:33
private void button11_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button12_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button13_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button14_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
switch (operation)
{
case '+':
d_result = arg1 + arg2;
break;
case '-':
d_result = arg1 - arg2;
break;
case '*':
d_result = arg1 * arg2;
break;
case '/':
if (arg2 == 0)
{
throw new ApplicationException();
}
else
{
d_result = arg1 / arg2;
}
break;
default:
throw new ApplicationException();
}
textBox1.Text = d_result.ToString();
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button12_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button13_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
private void button14_Click(object sender,EventArgs e)
{
Button btn = (Button)sender;
textBox1.Text = textBox1.Text + " " + btn.Text + " ";
}
switch (operation)
{
case '+':
d_result = arg1 + arg2;
break;
case '-':
d_result = arg1 - arg2;
break;
case '*':
d_result = arg1 * arg2;
break;
case '/':
if (arg2 == 0)
{
throw new ApplicationException();
}
else
{
d_result = arg1 / arg2;
}
break;
default:
throw new ApplicationException();
}
textBox1.Text = d_result.ToString();
应该少了些代码,operation变量没看见;switch这段函数应该在‘=’的按钮中把
不过我想这个应该是计算器的几个按钮,和一个显示(textBox1),按钮上显示的是“‘+’,‘-’,‘*’,‘/’”,通过点击这几个按钮,从而在textbox1上显示这个几个字符,并通过operation变量的值(‘+’,‘-’,‘*’,‘/’)中的一个得出结果2个数字的结果显示在textBox1里.
结束.
不过我想这个应该是计算器的几个按钮,和一个显示(textBox1),按钮上显示的是“‘+’,‘-’,‘*’,‘/’”,通过点击这几个按钮,从而在textbox1上显示这个几个字符,并通过operation变量的值(‘+’,‘-’,‘*’,‘/’)中的一个得出结果2个数字的结果显示在textBox1里.
结束.
private void button16_Click(object sender,EventArgs e)
英语翻译private void button1_Click(object sender,EventArgs e){if
protected void Button2_Click(object sender,EventArgs e) {
protected void Button1_Click(object sender,EventArgs e
VC++中object sender的用法
帮忙理解事件托管其中的object sender(事件发行者) 与keyEventArges e 的实际意义,与其作用
private void 和 private string 有什么区别
object
private
英语翻译class Company //公司类{private:Person *Worker; //员工表void Cl
#include class base { Private:int x,y; public:void setxy(int
1.给出如下代码:class Test{ private int m; public static void fun()