社区
C#
帖子详情
C#简易计算器
huminghua
2010-12-09 01:02:26
如题
...全文
86
5
打赏
收藏
C#简易计算器
如题
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
wanggenhu0
2010-12-09
打赏
举报
回复
这网上太多 了
tercelstar
2010-12-09
打赏
举报
回复
代码有点多,贴不上去,我的资源下面有一个计算器的实现源码,你可以看一下
tsp860901
2010-12-09
打赏
举报
回复
这是哥 以前做的 你看看对不对 !
tsp860901
2010-12-09
打赏
举报
回复
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace 计算器 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private double x;// 运算前数值 private double y;// 运算后数值 private string js;//运算符 private void Form1_Load(object sender, EventArgs e) { textBox1.Text = ""; } private void but_click(string text) {//操作数值按钮,文本框的显示 if (js == "") { textBox1.Text = textBox1.Text + text; } else { textBox1.Text = text; } } //以下是+-*/ private void button13_Click(object sender, EventArgs e) { x = Convert.ToDouble(textBox1.Text); js = button13.Text; } private void button12_Click(object sender, EventArgs e) { x = Convert.ToDouble(textBox1.Text); js = button12.Text; } private void button11_Click(object sender, EventArgs e) { x = Convert.ToDouble(textBox1.Text); js = button11.Text; } private void button14_Click(object sender, EventArgs e) { x = Convert.ToDouble(textBox1.Text); js = button14.Text; } //清除按钮 private void button16_Click(object sender, EventArgs e) { textBox1.Text = ""; x = 0; y = 0; js = ""; } //等号按钮 private void button15_Click(object sender, EventArgs e) { y = Convert.ToDouble(textBox1.Text); if (js == "/" && y == 0) { MessageBox.Show("除数为0错误!"); return; } else { switch (js) { case "+": textBox1.Text = (x + y).ToString(); break; case "-": textBox1.Text = (x - y).ToString(); break; case "*": textBox1.Text = (x * y).ToString(); break; } } } //以下数值按钮调用but_click()事件 ,主要是怎么把下面的简化,只写一个??? private void button9_Click(object sender, EventArgs e) { but_click(this.button9.Text); } private void button6_Click(object sender, EventArgs e) { but_click(this.button6.Text); } private void button8_Click(object sender, EventArgs e) { but_click(this.button8.Text); } private void button7_Click(object sender, EventArgs e) { but_click(this.button7.Text); } private void button5_Click(object sender, EventArgs e) { but_click(this.button5.Text); } private void button4_Click(object sender, EventArgs e) { but_click(this.button4.Text); } private void button3_Click(object sender, EventArgs e) { but_click(this.button3.Text); } private void button2_Click(object sender, EventArgs e) { but_click(this.button2.Text); } private void button1_Click(object sender, EventArgs e) { but_click(this.button1.Text); } private void button10_Click(object sender, EventArgs e) { but_click(this.button10.Text); } } }
C#
简易计算器
源码-非常适合初学者学习
C#
简易计算器
源码-非常适合初学者学习,
C#
简易计算器
源码-非常适合初学者学习,
C#
简易计算器
源码-非常适合初学者学习,重要的事情说三遍
C#
简易计算器
.zip
使用
c#
制作的简单计算器(包括加减乘除),对于一些复杂的连续计算例如连加、连减、连等这些内容没有进行考虑。
用
C#
实现工控上位机
结合Github高星开源项目SharpSCADA讲解工控上位机开发,重视基础,突出实战,为广大工控从业者、编程爱好者提供一种新颖的解决方案,可以快速搭建强大易用可扩展的工控上位机,并在此开源项目基础上开发工业大数据和MES系统,定制个性化的工业自动化行业解决方案。在学习过程中,可加深对
C#
语言和.NET平台的理解,进一步了解工业以太网协议,熟练对WPF技术的应用,透析组态软件的架构。
C#
简易计算器
详细源代码
C#
计算器 用
C#
模仿windows 7 下的计算器而制作出来的 可以实现连加,连等,混加,混等操作
C#
110,499
社区成员
642,576
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章