计算器c#程序设计.docx
《计算器c#程序设计.docx》由会员分享,可在线阅读,更多相关《计算器c#程序设计.docx(44页珍藏版)》请在冰豆网上搜索。
![计算器c#程序设计.docx](https://file1.bdocx.com/fileroot1/2023-1/29/689dfde8-d28d-4057-ad23-9d0747dea483/689dfde8-d28d-4057-ad23-9d0747dea4831.gif)
计算器c#程序设计
namespaceMyCalculator
{
partialclassCalculator
{
///
///必À?
需¨¨的Ì?
设¦¨¨计?
器¡Â变À?
量¢?
。
¡ê
///
privateSystem.ComponentModel.IContainercomponents=null;
///
///清?
理¤¨ª所¨´有®D正y在¨²使º1用®?
的Ì?
资Á¨º源¡ä。
¡ê
///
///如¨?
果?
应®|释º¨ª放¤?
托ªD管¨¹资Á¨º源¡ä,ê?
为atrue;ê?
否¤?
则¨°为afalse。
¡ê
protectedoverridevoidDispose(booldisposing)
{
if(disposing&&(components!
=null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#regionWindows窗ä¡ã体¬?
设¦¨¨计?
器¡Â生¦¨²成¨¦的Ì?
代䨲码?
///
///设¦¨¨计?
器¡Â支¡ì持?
所¨´需¨¨的Ì?
方¤?
法¤¡§-不?
要°a
///使º1用®?
代䨲码?
编À¨¤辑-器¡Â修T改?
此ä?
方¤?
法¤¡§的Ì?
内¨²容¨Y。
¡ê
///
privatevoidInitializeComponent()
{
this.num7=newSystem.Windows.Forms.Button();
this.num8=newSystem.Windows.Forms.Button();
this.num9=newSystem.Windows.Forms.Button();
this.button4=newSystem.Windows.Forms.Button();
this.button5=newSystem.Windows.Forms.Button();
this.num4=newSystem.Windows.Forms.Button();
this.num5=newSystem.Windows.Forms.Button();
this.num6=newSystem.Windows.Forms.Button();
this.button9=newSystem.Windows.Forms.Button();
this.num1=newSystem.Windows.Forms.Button();
this.button11=newSystem.Windows.Forms.Button();
this.num2=newSystem.Windows.Forms.Button();
this.num3=newSystem.Windows.Forms.Button();
this.button14=newSystem.Windows.Forms.Button();
this.button15=newSystem.Windows.Forms.Button();
this.num0=newSystem.Windows.Forms.Button();
this.button17=newSystem.Windows.Forms.Button();
this.button18=newSystem.Windows.Forms.Button();
this.button19=newSystem.Windows.Forms.Button();
this.button20=newSystem.Windows.Forms.Button();
this.button21=newSystem.Windows.Forms.Button();
this.button22=newSystem.Windows.Forms.Button();
this.button23=newSystem.Windows.Forms.Button();
this.textBox1=newSystem.Windows.Forms.TextBox();
this.SuspendLayout();
//
//num7
//
this.num7.ForeColor=System.Drawing.Color.Blue;
this.num7.Location=newSystem.Drawing.Point(12,63);
this.num7.Name="num7";
this.num7.Size=newSystem.Drawing.Size(37,29);
this.num7.TabIndex=0;
this.num7.Text="7";
this.num7.UseVisualStyleBackColor=true;
//
//num8
//
this.num8.ForeColor=System.Drawing.Color.Blue;
this.num8.Location=newSystem.Drawing.Point(51,63);
this.num8.Name="num8";
this.num8.Size=newSystem.Drawing.Size(37,29);
this.num8.TabIndex=1;
this.num8.Text="8";
this.num8.UseVisualStyleBackColor=true;
//
//num9
//
this.num9.ForeColor=System.Drawing.Color.Blue;
this.num9.Location=newSystem.Drawing.Point(90,63);
this.num9.Name="num9";
this.num9.Size=newSystem.Drawing.Size(37,29);
this.num9.TabIndex=2;
this.num9.Text="9";
this.num9.UseVisualStyleBackColor=true;
//
//button4
//
this.button4.ForeColor=System.Drawing.Color.Red;
this.button4.Location=newSystem.Drawing.Point(129,63);
this.button4.Name="button4";
this.button4.Size=newSystem.Drawing.Size(37,29);
this.button4.TabIndex=3;
this.button4.Text="/";
this.button4.UseVisualStyleBackColor=true;
this.button4.Click+=newSystem.EventHandler(this.operatorClick);
//
//button5
//
this.button5.ForeColor=System.Drawing.Color.Blue;
this.button5.Location=newSystem.Drawing.Point(168,63);
this.button5.Name="button5";
this.button5.Size=newSystem.Drawing.Size(37,29);
this.button5.TabIndex=4;
this.button5.Text="sqrt";
this.button5.UseVisualStyleBackColor=true;
this.button5.Click+=newSystem.EventHandler(this.button5_Click);
//
//num4
//
this.num4.ForeColor=System.Drawing.Color.Blue;
this.num4.Location=newSystem.Drawing.Point(12,95);
this.num4.Name="num4";
this.num4.Size=newSystem.Drawing.Size(37,29);
this.num4.TabIndex=5;
this.num4.Text="4";
this.num4.UseVisualStyleBackColor=true;
//
//num5
//
this.num5.ForeColor=System.Drawing.Color.Blue;
this.num5.Location=newSystem.Drawing.Point(51,95);
this.num5.Name="num5";
this.num5.Size=newSystem.Drawing.Size(37,29);
this.num5.TabIndex=6;
this.num5.Text="5";
this.num5.UseVisualStyleBackColor=true;
//
//num6
//
this.num6.ForeColor=System.Drawing.Color.Blue;
this.num6.Location=newSystem.Drawing.Point(90,95);
this.num6.Name="num6";
this.num6.Size=newSystem.Drawing.Size(37,29);
this.num6.TabIndex=7;
this.num6.Text="6";
this.num6.UseVisualStyleBackColor=true;
//
//button9
//
this.button9.ForeColor=System.Drawing.Color.Red;
this.button9.Location=newSystem.Drawing.Point(129,95);
this.button9.Name="button9";
this.button9.Size=newSystem.Drawing.Size(37,29);
this.button9.TabIndex=8;
this.button9.Text="*";
this.button9.UseVisualStyleBackColor=true;
this.button9.Click+=newSystem.EventHandler(this.operatorClick);
//
//num1
//
this.num1.ForeColor=System.Drawing.Color.Blue;
this.num1.Location=newSystem.Drawing.Point(12,127);
this.num1.Name="num1";
this.num1.Size=newSystem.Drawing.Size(37,29);
this.num1.TabIndex=9;
this.num1.Text="1";
this.num1.UseVisualStyleBackColor=true;
//
//button11
//
this.button11.ForeColor=System.Drawing.Color.Blue;
this.button11.Location=newSystem.Drawing.Point(168,95);
this.button11.Name="button11";
this.button11.Size=newSystem.Drawing.Size(37,29);
this.button11.TabIndex=10;
this.button11.Text="%";
this.button11.UseVisualStyleBackColor=true;
//
//num2
//
this.num2.ForeColor=System.Drawing.Color.Blue;
this.num2.Location=newSystem.Drawing.Point(51,127);
this.num2.Name="num2";
this.num2.Size=newSystem.Drawing.Size(37,29);
this.num2.TabIndex=11;
this.num2.Text="2";
this.num2.UseVisualStyleBackColor=true;
//
//num3
//
this.num3.ForeColor=System.Drawing.Color.Blue;
this.num3.Location=newSystem.Drawing.Point(90,127);
this.num3.Name="num3";
this.num3.Size=newSystem.Drawing.Size(37,29);
this.num3.TabIndex=12;
this.num3.Text="3";
this.num3.UseVisualStyleBackColor=true;
//
//button14
//
this.button14.ForeColor=System.Drawing.Color.Blue;
this.button14.Location=newSystem.Drawing.Point(168,127);
this.button14.Name="button14";
this.button14.Size=newSystem.Drawing.Size(37,29);
this.button14.TabIndex=13;
this.button14.Text="1/x";
this.button14.UseVisualStyleBackColor=true;
this.button14.Click+=newSystem.EventHandler(this.button14_Click);
//
//button15
//
this.button15.ForeColor=System.Drawing.Color.Red;
this.button15.Location=newSystem.Drawing.Point(129,127);
this.button15.Name="button15";
this.button15.Size=newSystem.Drawing.Size(37,29);
this.button15.TabIndex=14;
this.button15.Text="-";
this.button15.UseVisualStyleBackColor=true;
this.button15.Click+=newSystem.EventHandler(this.operatorClick);
//
//num0
//
this.num0.ForeColor=System.Drawing.Color.Blue;
this.num0.Location=newSystem.Drawing.Point(12,159);
this.num0.Name="num0";
this.num0.Size=newSystem.Drawing.Size(37,29);
this.num0.TabIndex=15;
this.num0.Text="0";
this.num0.UseVisualStyleBackColor=true;
//
//button17
//
this.button17.ForeColor=System.Drawing.Color.Blue;
this.button17.Location=newSystem.Drawing.Point(51,159);
this.button17.Name="button17";
this.button17.Size=newSystem.Drawing.Size(37,29);
this.button17.TabIndex=16;
this.button17.Text="+/-";
this.button17.UseVisualStyleBackColor=true;
this.button17.Click+=newSystem.EventHandler(this.button17_Click);
//
//button18
//
this.button18.ForeColor=System.Drawing.Color.Blue;
this.button18.Location=newSystem.Drawing.Point(90,159);
this.button18.Name="button18";
this.button18.Size=newSystem.Drawing.Size(37,29);
this.button18.TabIndex=17;
this.button18.Text=".";
this.button18.UseVisualStyleBackColor=true;
this.button18.Click+=newSystem.EventHandler(this.pointClick);
//
//button19
//
this.button19.ForeColor=System.Drawing.Color.Red;
this.button19.Location=newSystem.Drawing.Point(129,159);
this.button19.Name="button19";
this.button19.Size=newSystem.Drawing.Size(37,29);
this.button19.TabIndex=18;
this.button19.Text="+";
this.button19.UseVisualStyleBackColor=true;
this.button19.Click+=newSystem.EventHandler(this.operatorClick);
//
//button20
//
this.button20.ForeColor=System.Drawing.Color.Red;
this.button20.Location=newSystem.Drawing.Point(168,159);
this.button20.Name="button20";
this.button20.Size=newSystem.Drawing.Size(37,29);
this.button20.TabIndex=19;
this.button20.Text="=";
this.button20.UseVisualStyleBackColor=true;
this.button20.Click+=newSystem.EventHandler(this.button20_Click);
//
//button21
//
this.button21.ForeColor=System.Drawing.Color.Red;
this.button21.Location=newSystem.Drawing.Point(12,29);
this.button21.Name="button21";
this.button21.Size=newSystem.Drawing.Size(59,26);
this.button21.TabIndex=20;
this.button21.Text="退ª?
格?
";
this.button21.UseVisualStyleBackColor=true;
this.button21.Click+=newSystem.EventHandler(this.button21_Click);
//
//button22
//
this.button22.ForeColor=System.Drawing.Color.Red;
this.button22.Location=newSystem.Drawing.Point(79,29);
this.button22.Name="button22";
this.button22.Size=newSystem.Drawing.Size(59,26);
this.button22.TabIndex=21;
this.button22.Text="CE";
this.button22.UseVisualStyleBackColor=true;
this.button22.Click+=newSystem.EventHandler(this.button22_Click);
//
//button23
//
this.button23.ForeColor=System.Drawing.Color.Red;
this.button23.Location=newSystem