界面上放一个button按钮,3个lable控件,button里面的代码
lable3.text=Convert.ToInt32(lable1.text)+Convert.ToInt32(lable2.text);
private void Form1_Load(object sender, EventArgs e) {
double result = Add(5, 6);
}
private double Add(double a, double b) {
return a + b;
}