C#计算
发布日期:2021-06-30 12:05:50 浏览次数:2 分类:技术文章

本文共 1237 字,大约阅读时间需要 4 分钟。

代码如下:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace _3{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {                label1.ForeColor = Color.Red;        }        private void button2_Click(object sender, EventArgs e)        {            label1.ForeColor = Color.Blue;        }        private void button3_Click(object sender, EventArgs e)        {            Close();        }        private void button1_Click_1(object sender, EventArgs e)        {            float ss, ee;            ss = Convert.ToSingle(textBox1.Text);            ee = Convert.ToSingle(textBox2.Text);            textBox3.Text = Convert.ToString(ss * ee);        }        private void button2_Click_1(object sender, EventArgs e)        {            textBox1.Text = "";            textBox2.Text = "";            textBox3.Text = "";        }        private void button3_Click_1(object sender, EventArgs e)        {            Close();        }    }}

执行效果如下:

在这里插入图片描述

转载地址:https://jackzhang.blog.csdn.net/article/details/83032002 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:C#的groupbox和字体修改
下一篇:C#窗体程序

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年04月17日 18时25分26秒