资源简介
c#编写的简单计算器代码,源代码是我在网上下载的,希望对同学们学习C#有好的帮助
代码片段和文件信息
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 Ex4._1_Calculator
{
public partial class Form1 : Form
{
double num1=1num2num_addnum_multiply=1num_mulus=0num_divade=0result;
string Operater;
bool b = falseb1 = true;
public Form1()
{
InitializeComponent();
}
public void NumClick(string myNumber)
{
b1 = true;
if (textBox1.Text == “0“ || b == true)
{
textBox1.Text = ““;
textBox1.Text = textBox1.Text + myNumber;
}
else
{
textBox1.Text = textBox1.Text + myNumber;
}
b = false;
}
private void Form1_Load(object sender EventArgs e)
{
textBox1.Text = “0“;
}
private void buttonZero_Click(object sender EventArgs e)
{
NumClick(“0“);
}
private void buttonOne_Click(object sender EventArgs e)
{
NumClick(“1“);
}
private void buttonTwo_Click(object sender EventArgs e)
{
NumClick(“2“);
}
private void buttonThree_Click(object sender EventArgs e)
{
NumClick(“3“);
}
private void buttonFour_Click(object sender EventArgs e)
{
NumClick(“4“);
}
private void buttonFive_Click(object sender EventArgs e)
{
NumClick(“5“);
}
private void buttonSix_Click(object sender EventArgs e)
{
NumClick(“6“);
}
private void buttonSeven_Click(object sender EventArgs e)
{
NumClick(“7“);
}
private void buttonEight_Click(object sender EventArgs e)
{
NumClick(“8“);
}
private void buttonNine_Click(object sender EventArgs e)
{
NumClick(“9“);
}
private void buttonDot_Click(object sender EventArgs e)
{
if (textBox1.Text.Contains(“.“)==false)
{
textBox1.Text = textBox1.Text + “.“;
}
}
private void buttonC_Click(object sender EventArgs e)
{
textBox1.Text = “0“;
num1 = 0;
num_add = 0;
num2 = 0;
num_divade = 0;
num_multiply = 0;
num_mulus = 0;
}
private void buttonDivade_Click(object sender EventArgs e)
{
b = true;
if (b1 == true)
{
num1 = double.Parse(textBox1.Text);
if (num_divade != 0)
{
num
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 890 2013-05-04 15:15 Ex4.1 Calculator\Ex4.1 Calculator.sln
I.A..H. 8192 2013-05-14 22:59 Ex4.1 Calculator\Ex4.1 Calculator.suo
文件 3692 2013-05-04 15:45 Ex4.1 Calculator\Ex4.1 Calculator\Ex4.1 Calculator.csproj
文件 5926 2013-05-09 17:45 Ex4.1 Calculator\Ex4.1 Calculator\Form1.cs
文件 16365 2013-05-09 17:45 Ex4.1 Calculator\Ex4.1 Calculator\Form1.Designer.cs
文件 5817 2013-05-09 17:45 Ex4.1 Calculator\Ex4.1 Calculator\Form1.resx
文件 498 2013-05-04 15:15 Ex4.1 Calculator\Ex4.1 Calculator\Program.cs
文件 36352 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\bin\Debug\Ex4.1 Calculator.pdb
文件 11600 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\bin\Debug\Ex4.1 Calculator.vshost.exe
文件 490 2010-03-17 22:39 Ex4.1 Calculator\Ex4.1 Calculator\bin\Debug\Ex4.1 Calculator.vshost.exe.manifest
文件 15360 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\bin\Debug\Ex4.1 Calculator.exe
文件 28160 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\bin\Release\Ex4.1 Calculator.pdb
文件 11600 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\bin\Release\Ex4.1 Calculator.vshost.exe
文件 490 2010-03-17 22:39 Ex4.1 Calculator\Ex4.1 Calculator\bin\Release\Ex4.1 Calculator.vshost.exe.manifest
文件 5359 2013-05-09 11:50 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6322 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 3421 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4.1 Calculator.csproj.FileListAbsolute.txt
文件 9040 2013-05-09 12:18 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4.1 Calculator.csprojResolveAssemblyReference.cache
文件 15360 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4.1 Calculator.exe
文件 36352 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4.1 Calculator.pdb
文件 180 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4._1_Calculator.Form1.resources
文件 180 2013-05-09 08:36 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4._1_Calculator.Properties.Resources.resources
文件 300 2013-05-09 09:36 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\GenerateResource.read.1.tlog
文件 738 2013-05-09 09:36 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\GenerateResource.write.1.tlog
文件 975 2013-05-13 19:56 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Debug\Ex4.1 Calculator.csproj.GenerateResource.Cache
文件 6308 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache
文件 780 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Release\Ex4.1 Calculator.csproj.FileListAbsolute.txt
文件 975 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Release\Ex4.1 Calculator.csproj.GenerateResource.Cache
文件 14848 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Release\Ex4.1 Calculator.exe
文件 28160 2013-05-09 17:41 Ex4.1 Calculator\Ex4.1 Calculator\obj\x86\Release\Ex4.1 Calculator.pdb
............此处省略22个文件信息
- 上一篇:C#制作科学计算器课程设计(源程序)
- 下一篇:c# 遗传算法 最短路径
相关资源
- c# 遗传算法 最短路径
- C#制作科学计算器课程设计(源程序)
- C#实现Socket编程 (异步通讯解决Tcp粘
- 基于c#的手机短信收发程序
- asp.net+ajax 写的无刷新登录技术没有使
- 软件开发实习日记
- C# post 传值 和接收值
- 批量裁剪图片
- 中三种截屏方式小结
- c#+WINFORM+漂亮的软件启动界面特效源码
- C#计算器源码 C#计算器源码 C#计算器源
- C#读写HID设备
- PDF合并拆分 C#源码
- C#进销存系统
- C#蚁群算法求解TSP问题
- C#winform实现钢琴7音
- C#生成和解析二维码及调用摄像头识别
- C#考勤管理系统完整源码
- C#窗体猜数小程序源码
- C#WinForm使用CefSharp内嵌
- zw_C#人力资源管理系统源代码.zip
- C#定坐标快捷截图工具及源代码可双屏
- C#手写识别程序源码(完整版)
- C#软件授权源码(亲测可用)
- Winform可视化打印模板设计(完整版)
- C#自定义控件--美化ComboBox源码(十分
- C#实现socket通讯
- 特别全面的DbHelper
- unity旋转,缩放,移动控制脚本
- C#制作的小游戏
评论
共有 条评论