当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > (原创)C#编写的windows计算器----源代码

ASP.NET
一个无刷新效果定时自动更新页面的例子
ASP.NET2.0的控件状态和视图状态探讨
用好ASP.NET 2.0的URL映射
详解:如何在.NET中访问MySQL数据库?
如何实现Asp与Asp.Net共享Session
利用.net的强大功能发送email
.NET中加密与解密QueryString的方法
Asp.net生成htm静态文件的两种途径
C#定时器的使用
从XML文件中读取数据绑定到DropDownList
ASP.NET 2.0 里输出文本格式流
用.net动态创建类的实例
.Net下的MSMQ的同步异步调用
ASP.NET 2.0实现防止同一用户同时登陆
asp.NET自定义服务器控件内部细节
组合.NET数据控件构建强大用户接口
用ASP.NET 2.0 FormView控件控制显示
菜鸟也学习ASP.NET如何读取数据库内容
教你简单方便获取Web设计的免费资源
专家详解:复杂表达式的执行步骤

ASP.NET 中的 (原创)C#编写的windows计算器----源代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 35 ::
收藏到网摘: n/a

using System;using System.Drawing;using System.Windows;using System.Windows.Forms;using System.Collections;using System.ComponentModel;using System.Data;namespace comput{ /// /// 这是一个计算器的简单实现。 /// public class Form1 : System.Windows.Forms.Form { #region 控件声明 private System.Windows.Forms.TextBox txtShow; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button btn_rev; private System.Windows.Forms.Button btn_dot; private System.Windows.Forms.Button btn_add; private System.Windows.Forms.Button btn_equ; private System.Windows.Forms.Button btn_sign; private System.Windows.Forms.Button btn_sub; private System.Windows.Forms.Button btn_mul; private System.Windows.Forms.Button btn_0; private System.Windows.Forms.Button btn_3; private System.Windows.Forms.Button btn_2; private System.Windows.Forms.Button btn_1; private System.Windows.Forms.Button btn_6; private System.Windows.Forms.Button btn_5; private System.Windows.Forms.Button btn_4; private System.Windows.Forms.Button btn_sqrt; private System.Windows.Forms.Button btn_div; private System.Windows.Forms.Button btn_7; private System.Windows.Forms.Button btn_8; private System.Windows.Forms.Button btn_9; private System.Windows.Forms.MainMenu mainMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.Button btn_sqr; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.MenuItem menuItem5; private System.Windows.Forms.MenuItem menuItem6; private System.Windows.Forms.Button c; private System.Windows.Forms.Button ce; private System.Windows.Forms.MenuItem menuItem8; private System.Windows.Forms.MenuItem menuItem9; private System.Windows.Forms.MenuItem menuItem10; /// /// 必需的设计器变量。 /// private System.ComponentModel.Container components = null; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // } /// /// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #endregion #region 各控件的属性的方法Windows Form Designer generated code /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.txtShow = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.c = new System.Windows.Forms.Button(); this.ce = new System.Windows.Forms.Button(); this.btn_rev = new System.Windows.Forms.Button(); this.btn_dot = new System.Windows.Forms.Button(); this.btn_add = new System.Windows.Forms.Button(); this.btn_equ = new System.Windows.Forms.Button(); this.btn_sign = new System.Windows.Forms.Button(); this.btn_sub = new System.Windows.Forms.Button(); this.btn_mul = new System.Windows.Forms.Button(); this.btn_0 = new System.Windows.Forms.Button(); this.btn_3 = new System.Windows.Forms.Button(); this.btn_2 = new System.Windows.Forms.Button(); this.btn_1 = new System.Windows.Forms.Button(); this.btn_6 = new System.Windows.Forms.Button(); this.btn_5 = new System.Windows.Forms.Button(); this.btn_4 = new System.Windows.Forms.Button(); this.btn_sqrt = new System.Windows.Forms.Button(); this.btn_div = new System.Windows.Forms.Button(); this.btn_7 = new System.Windows.Forms.Button(); this.btn_8 = new System.Windows.Forms.Button(); this.btn_9 = new System.Windows.Forms.Button(); this.btn_sqr = new System.Windows.Forms.Button(); this.mainMenu1 = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System