c计算器模仿windows计算器

c计算器模仿windows计算器

ID:22908285

大小:77.68 KB

页数:8页

时间:2018-11-01

c计算器模仿windows计算器_第1页
c计算器模仿windows计算器_第2页
c计算器模仿windows计算器_第3页
c计算器模仿windows计算器_第4页
c计算器模仿windows计算器_第5页
资源描述:

《c计算器模仿windows计算器》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、Form1:标准型计算器usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication5{publicpartialclassForm1:Form{stringfh;stringfz;publicDoublea,b;publicdoublec;publicF

2、orm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){}privatevoidbutton1_Click(objectsender,EventArgse){textBox1.Text+=button1.Text;}privatevoidbutton2_Click(objectsender,EventArgse){textBox1.Text+=button2.Text;}privatevoidbutton3_Click(objectsender,EventArgse){textBox1.Tex

3、t+=button3.Text;}privatevoidbutton4_Click(objectsender,EventArgse){textBox1.Text+=button4.Text;}privatevoidbutton5_Click(objectsender,EventArgse){textBox1.Text+=button5.Text;}privatevoidbutton6_Click(objectsender,EventArgse){textBox1.Text+=button6.Text;}privatevoidbutton7_Click(objectsender,EventA

4、rgse){textBox1.Text+=button7.Text;}privatevoidbutton8_Click(objectsender,EventArgse){textBox1.Text+=button8.Text;}privatevoidbutton9_Click(objectsender,EventArgse){textBox1.Text+=button9.Text;}privatevoidbutton10_Click(objectsender,EventArgse){textBox1.Text+=button10.Text;}privatevoidbutton11_Clic

5、k(objectsender,EventArgse){a=Convert.ToDouble(textBox1.Text);fh=button11.Text;textBox1.Text="";}privatevoidbutton12_Click(objectsender,EventArgse){a=Convert.ToDouble(textBox1.Text);fh=button12.Text;textBox1.Text="";}privatevoidbutton13_Click(objectsender,EventArgse){a=Convert.ToDouble(textBox1.Tex

6、t);fh=button13.Text;textBox1.Text="";}privatevoidbutton14_Click(objectsender,EventArgse){a=Convert.ToDouble(textBox1.Text);fh=button14.Text;textBox1.Text="";}privatevoidbutton15_Click(objectsender,EventArgse){b=Convert.ToDouble(textBox1.Text);switch(fh){case"+":textBox1.Text=Convert.ToString(a+b);

7、break;case"-":textBox1.Text=Convert.ToString(a-b);break;case"*":textBox1.Text=Convert.ToString(a*b);break;case"/":textBox1.Text=Convert.ToString(a/b);break;}}privatevoidbutton16_Click(objectsender,EventArgse){tex

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。