作业two

2018-10-17  本文已影响0人  零二幺五

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

上一篇 下一篇

猜你喜欢

热点阅读