private void add_Click(object sender, EventArgs e)
{
string a= number1.Text;
string b= number2.Text;
float a1=float.Parse(a);
float b1=float.Parse(b);
mesageebox.show("+"+(a1+b1).Tostring);
}
private void minue_Click(object sender, EventArgs e)
{
string a= number1.Text;
string b= number2.Text;
float a1=float.Parse(a);
float b1=float.Parse(b);
float answer d=a1-b1;
if(d<0)
{mesageebox.show("-"+d.Tostring);}
else if(d>0)
{mesageebox.show("+"+d.Tostring);}
}
try catch 捕捉错误!
我在网吧写的,你将就看一下把
参照http://zhidao.baidu.com/question/103493840.html