⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 说明: 此计算机可以计算同时超过多个操作项的什. 例如: y = 3 + 64 * (2 + 3^5) + sinPI 的值
💻 CS
📖 第 1 页 / 共 4 页
字号:
			// 
			this.button18.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button18.Location = new System.Drawing.Point(24, 288);
			this.button18.Name = "button18";
			this.button18.Size = new System.Drawing.Size(32, 23);
			this.button18.TabIndex = 25;
			this.button18.Text = "Tan";
			this.button18.Click += new System.EventHandler(this.button18_Click);
			// 
			// button19
			// 
			this.button19.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button19.Location = new System.Drawing.Point(24, 328);
			this.button19.Name = "button19";
			this.button19.Size = new System.Drawing.Size(32, 23);
			this.button19.TabIndex = 26;
			this.button19.Text = "Cot";
			this.button19.Click += new System.EventHandler(this.button19_Click);
			// 
			// button20
			// 
			this.button20.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button20.Location = new System.Drawing.Point(64, 208);
			this.button20.Name = "button20";
			this.button20.Size = new System.Drawing.Size(56, 23);
			this.button20.TabIndex = 27;
			this.button20.Text = "ArcSin";
			this.button20.Click += new System.EventHandler(this.button20_Click);
			// 
			// button21
			// 
			this.button21.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button21.Location = new System.Drawing.Point(64, 248);
			this.button21.Name = "button21";
			this.button21.Size = new System.Drawing.Size(56, 23);
			this.button21.TabIndex = 28;
			this.button21.Text = "ArcCos";
			this.button21.Click += new System.EventHandler(this.button21_Click);
			// 
			// button22
			// 
			this.button22.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button22.Location = new System.Drawing.Point(64, 288);
			this.button22.Name = "button22";
			this.button22.Size = new System.Drawing.Size(56, 23);
			this.button22.TabIndex = 29;
			this.button22.Text = "ArcTan";
			this.button22.Click += new System.EventHandler(this.button22_Click);
			// 
			// button23
			// 
			this.button23.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button23.Location = new System.Drawing.Point(64, 328);
			this.button23.Name = "button23";
			this.button23.Size = new System.Drawing.Size(56, 23);
			this.button23.TabIndex = 30;
			this.button23.Text = "ArcCot";
			this.button23.Click += new System.EventHandler(this.button23_Click);
			// 
			// button24
			// 
			this.button24.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button24.Location = new System.Drawing.Point(136, 208);
			this.button24.Name = "button24";
			this.button24.Size = new System.Drawing.Size(32, 23);
			this.button24.TabIndex = 31;
			this.button24.Text = "Sec";
			this.button24.Click += new System.EventHandler(this.button24_Click);
			// 
			// button25
			// 
			this.button25.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button25.Location = new System.Drawing.Point(136, 248);
			this.button25.Name = "button25";
			this.button25.Size = new System.Drawing.Size(32, 23);
			this.button25.TabIndex = 32;
			this.button25.Text = "Csc";
			this.button25.Click += new System.EventHandler(this.button25_Click);
			// 
			// button26
			// 
			this.button26.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button26.Location = new System.Drawing.Point(136, 288);
			this.button26.Name = "button26";
			this.button26.Size = new System.Drawing.Size(32, 23);
			this.button26.TabIndex = 33;
			this.button26.Text = "Ln";
			this.button26.Click += new System.EventHandler(this.button26_Click);
			// 
			// button27
			// 
			this.button27.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.button27.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button27.Location = new System.Drawing.Point(320, 328);
			this.button27.Name = "button27";
			this.button27.Size = new System.Drawing.Size(48, 23);
			this.button27.TabIndex = 34;
			this.button27.Text = "次方";
			this.button27.Click += new System.EventHandler(this.button27_Click);
			// 
			// button28
			// 
			this.button28.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button28.Location = new System.Drawing.Point(432, 208);
			this.button28.Name = "button28";
			this.button28.Size = new System.Drawing.Size(32, 23);
			this.button28.TabIndex = 35;
			this.button28.Text = ")";
			this.button28.Click += new System.EventHandler(this.button28_Click);
			// 
			// button29
			// 
			this.button29.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button29.Location = new System.Drawing.Point(384, 208);
			this.button29.Name = "button29";
			this.button29.Size = new System.Drawing.Size(32, 23);
			this.button29.TabIndex = 36;
			this.button29.Text = "(";
			this.button29.Click += new System.EventHandler(this.button29_Click);
			// 
			// button30
			// 
			this.button30.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.button30.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button30.Location = new System.Drawing.Point(384, 328);
			this.button30.Name = "button30";
			this.button30.Size = new System.Drawing.Size(80, 23);
			this.button30.TabIndex = 37;
			this.button30.Text = "==";
			this.button30.Click += new System.EventHandler(this.button30_Click);
			// 
			// button31
			// 
			this.button31.BackColor = System.Drawing.SystemColors.InactiveCaption;
			this.button31.ForeColor = System.Drawing.Color.Black;
			this.button31.Location = new System.Drawing.Point(328, 168);
			this.button31.Name = "button31";
			this.button31.Size = new System.Drawing.Size(96, 23);
			this.button31.TabIndex = 38;
			this.button31.Text = "Back Space";
			this.button31.Click += new System.EventHandler(this.button31_Click);
			// 
			// button32
			// 
			this.button32.BackColor = System.Drawing.SystemColors.InactiveCaptionText;
			this.button32.ForeColor = System.Drawing.SystemColors.ControlText;
			this.button32.Location = new System.Drawing.Point(432, 168);
			this.button32.Name = "button32";
			this.button32.Size = new System.Drawing.Size(32, 23);
			this.button32.TabIndex = 39;
			this.button32.Text = "CE";
			this.button32.Click += new System.EventHandler(this.button32_Click);
			// 
			// label1
			// 
			this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.label1.Location = new System.Drawing.Point(40, 72);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(64, 20);
			this.label1.TabIndex = 40;
			this.label1.Text = "计算结果:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// endbox
			// 
			this.endbox.Anchor = System.Windows.Forms.AnchorStyles.Left;
			this.endbox.Location = new System.Drawing.Point(112, 72);
			this.endbox.Name = "endbox";
			this.endbox.Size = new System.Drawing.Size(136, 21);
			this.endbox.TabIndex = 41;
			this.endbox.Text = "0.000000";
			// 
			// button33
			// 
			this.button33.ForeColor = System.Drawing.SystemColors.HotTrack;
			this.button33.Location = new System.Drawing.Point(136, 328);
			this.button33.Name = "button33";
			this.button33.Size = new System.Drawing.Size(32, 23);
			this.button33.TabIndex = 42;
			this.button33.Text = "Л";
			this.button33.Click += new System.EventHandler(this.button33_Click);
			// 
			// endList
			// 
			this.endList.Location = new System.Drawing.Point(112, 112);
			this.endList.Multiline = true;
			this.endList.Name = "endList";
			this.endList.Size = new System.Drawing.Size(352, 21);
			this.endList.TabIndex = 43;
			this.endList.Tag = "ff";
			this.endList.Text = "";
			this.endList.TextChanged += new System.EventHandler(this.endList_TextChanged);
			// 
			// label3
			// 
			this.label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.label3.Location = new System.Drawing.Point(40, 112);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(64, 20);
			this.label3.TabIndex = 44;
			this.label3.Text = "结果列表:";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			this.label3.Click += new System.EventHandler(this.label3_Click);
			// 
			// button34
			// 
			this.button34.ForeColor = System.Drawing.SystemColors.ControlText;
			this.button34.Location = new System.Drawing.Point(24, 168);
			this.button34.Name = "button34";
			this.button34.Size = new System.Drawing.Size(96, 23);
			this.button34.TabIndex = 45;
			this.button34.Text = "清除结果列表";
			this.button34.Click += new System.EventHandler(this.button34_Click);
			// 
			// button35
			// 
			this.button35.Location = new System.Drawing.Point(408, 72);
			this.button35.Name = "button35";
			this.button35.Size = new System.Drawing.Size(56, 23);
			this.button35.TabIndex = 46;
			this.button35.Text = "帮助";
			this.button35.Click += new System.EventHandler(this.button35_Click);
			// 
			// button40
			// 
			this.button40.Location = new System.Drawing.Point(408, 32);
			this.button40.Name = "button40";
			this.button40.Size = new System.Drawing.Size(56, 23);
			this.button40.TabIndex = 54;
			this.button40.Text = "重写";
			this.button40.Click += new System.EventHandler(this.button40_Click);
			// 
			// Form
			// 
			this.AcceptButton = this.button30;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.InactiveCaption;
			this.ClientSize = new System.Drawing.Size(488, 390);
			this.Controls.Add(this.button40);
			this.Controls.Add(this.button35);
			this.Controls.Add(this.button34);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.endList);
			this.Controls.Add(this.button33);
			this.Controls.Add(this.endbox);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.button32);
			this.Controls.Add(this.button31);
			this.Controls.Add(this.button30);
			this.Controls.Add(this.button29);
			this.Controls.Add(this.button28);
			this.Controls.Add(this.button27);
			this.Controls.Add(this.button26);
			this.Controls.Add(this.button25);
			this.Controls.Add(this.button24);
			this.Controls.Add(this.button23);
			this.Controls.Add(this.button22);
			this.Controls.Add(this.button21);
			this.Controls.Add(this.button20);
			this.Controls.Add(this.button19);
			this.Controls.Add(this.button18);
			this.Controls.Add(this.button17);
			this.Controls.Add(this.button16);
			this.Controls.Add(this.button15);
			this.Controls.Add(this.button14);
			this.Controls.Add(this.button13);
			this.Controls.Add(this.button12);
			this.Controls.Add(this.button11);
			this.Controls.Add(this.button10);
			this.Controls.Add(this.button9);
			this.Controls.Add(this.button8);
			this.Controls.Add(this.button7);
			this.Controls.Add(this.button6);
			this.Controls.Add(this.button5);
			this.Controls.Add(this.button4);
			this.Controls.Add(this.button3);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.expressBox);
			this.MaximizeBox = false;
			this.Name = "Form";
			this.Text = "多功能计算器";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form());
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
		}
		private void Form_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			//label3.Text="X: "+e.X.ToString()+" ,Y: "+e.Y.ToString();
		}

		/*private void button1_Click(object sender, System.EventArgs e)
		{
			StartExcute();			           
		}
		private void button2_Click(object sender, System.EventArgs e)
		{
			Application.Exit();
		}*/
		private void expressBox_TextChanged(object sender, System.EventArgs e)
		{
		
		}
		public void InitializeOpchTblStack()  //制定运算符及其特性(优先级和单双目)的运算符表
		{
			//public int[]osp={6,6,6,6,6,6,6,6,6,6,6,5,3,3,2,2,7,0,1};  //数组中元素依次为: "sin","cos","tan","cot","arcsin","arccos","arctan","sec","csc","ln","^","*","/","+","-","(",")",""  的栈外(因为有的运算符是从右向左计算,有的是从左往右计算,用内外优先级可以限制其执行顺序)优先级
		    //public int[]isp={5,5,5,5,5,5,5,5,5,5,5,4,3,3,2,2,1,1};      //数组中元素依次为: "sin","cos","tan","cot","arcsin","arccos","arctan","sec","csc","ln","^","*","/","+","-","(","end" 的栈内(因为有的运算符是从右向左计算,有的是从左往右计算,用内外优先级可以限制其执行顺序)优先级
			opchTbl[0].op="sin"; opchTbl[0].code=1; opchTbl[0].grade='s';
			opchTbl[1].op="cos"; opchTbl[1].code=2; opchTbl[1].grade='s'; 
			opchTbl[2].op="tan"; opchTbl[2].code=3; opchTbl[2].grade='s'; 
			opchTbl[3].op="cot"; opchTbl[3].code=4; opchTbl[3].grade='s';
			opchTbl[4].op="arcsin"; opchTbl[4].code=5; opchTbl[4].grade='s';
			opchTbl[5].op="arccos"; opchTbl[5].code=6; opchTbl[5].grade='s';
			opchTbl[6].op="arctan"; opchTbl[6].code=7; opchTbl[6].grade='s';
			opchTbl[7].op="arccot"; opchTbl[7].code=8; opchTbl[7].grade='s';
			opchTbl[8].op="sec"; opchTbl[8].code=9; opchTbl[8].grade='s';
			opchTbl[9].op="csc"; opchTbl[9].code=10; opchTbl[9].grade='s';
			opchTbl[10].op="ln"; opchTbl[10].code=11; opchTbl[10].grade='s';
			opchTbl[11].op="^"; opchTbl[11].code=12; opchTbl[11].grade='d';
			opchTbl[12].op="*"; opchTbl[12].code=13; opchTbl[12].grade='d';
			opchTbl[13].op="/"; opchTbl[13].code=14; opchTbl[13].grade='d';
			opchTbl[14].op="+"; opchTbl[14].code=15; opchTbl[14].grade='d';
			opchTbl[15].op="-"; opchTbl[15].code=16; opchTbl[15].grade='d';
			opchTbl[16].op="("; opchTbl[16].code=17; opchTbl[16].grade='d';
			opchTbl[17].op=")"; opchTbl[17].code=18; opchTbl[17].grade='d';
			opchTbl[18].op=" "; opchTbl[18].code=19; opchTbl[18].grade='d';
		    startString=expressBox.Text;
			//将输入的运算表达式存入"起始字符串"
		   //dataStack.Initialize(); operateStack.Initialize();
		}
		public void CreterionFaction()
		{
			//以下为消去待扫描字符串中的所有空格字符
			for(int i=0;i<startString.Length;i++)
				if(startString[i].Equals(' '))
                {
					startString=startString.Remove(i,1);
					i--;
				}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -