![](https://img.haomeiwen.com/i14494330/8ad54b1a96cc86f4.png)
private void button1_Click(object sender, EventArgs e)
{
float a = 0;
float b = 0;
float c = 0; //定义字符
a = float.Parse(textBox1.Text);
b = float.Parse(textBox2.Text); //将文本数值提取出来
c = a * b; //将文本框一二的字符相乘
textBox3.Text = c.ToString(); //最后得出积并放入文本框三中
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = ""; //将文本框清空
}
end
网友评论