2018-10-17乘法计算器

2018-10-18  本文已影响0人  小短腿慢慢走

计算按钮

 private void button1_Click(object sender, EventArgs e)
 { 

  float num1 = 0;

  float num2 = 0;

  float result = 0;

  num1 = float.Parse(textBox1.Text); 

  num2 = float.Parse(textBox2.Text);

  result = num1 * num2;

  textBox3.Text = result.ToString(); 
}

清除按钮

 private void button2_Click(object sender, EventArgs e)

 {

  textBox1.Text = "";

  textBox2.Text = "";

  textBox3.Text = "";

 }
image
上一篇下一篇

猜你喜欢

热点阅读