作业two

作者: 零二幺五 | 来源:发表于2018-10-17 21:40 被阅读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

相关文章

网友评论

      本文标题:作业two

      本文链接:https://www.haomeiwen.com/subject/xtldzftx.html