Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace ITCO221_L.Simpkins_Unit4
- {
- public partial class frmCalculator : Form
- {
- //class level variables
- double num1;
- double num2;
- double answer;
- string mathOperator = "";
- public frmCalculator()
- {
- InitializeComponent();
- }
- private void InitializeComponent()
- {
- #region "button code"
- {
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button8 = new System.Windows.Forms.Button();
- this.button9 = new System.Windows.Forms.Button();
- this.button10 = new System.Windows.Forms.Button();
- this.button11 = new System.Windows.Forms.Button();
- this.button12 = new System.Windows.Forms.Button();
- this.button13 = new System.Windows.Forms.Button();
- this.button14 = new System.Windows.Forms.Button();
- this.button15 = new System.Windows.Forms.Button();
- this.button16 = new System.Windows.Forms.Button();
- this.button17 = new System.Windows.Forms.Button();
- this.button18 = new System.Windows.Forms.Button();
- this.button19 = new System.Windows.Forms.Button();
- this.button20 = new System.Windows.Forms.Button();
- this.button21 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(303, 12);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(151, 20);
- this.textBox1.TabIndex = 0;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(361, 62);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 1;
- this.button1.Text = "tan";
- this.button1.UseVisualStyleBackColor = true;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(203, 121);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 2;
- this.button2.Text = "*";
- this.button2.UseVisualStyleBackColor = true;
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(203, 150);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 3;
- this.button3.Text = "1";
- this.button3.UseVisualStyleBackColor = true;
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(203, 91);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(75, 23);
- this.button4.TabIndex = 4;
- this.button4.Text = "sln";
- this.button4.UseVisualStyleBackColor = true;
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(203, 62);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(75, 23);
- this.button5.TabIndex = 5;
- this.button5.Text = "C";
- this.button5.UseVisualStyleBackColor = true;
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(280, 150);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(75, 23);
- this.button6.TabIndex = 6;
- this.button6.Text = "2";
- this.button6.UseVisualStyleBackColor = true;
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(280, 179);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(75, 23);
- this.button7.TabIndex = 7;
- this.button7.Text = "5";
- this.button7.UseVisualStyleBackColor = true;
- //
- // button8
- //
- this.button8.Location = new System.Drawing.Point(280, 124);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(75, 23);
- this.button8.TabIndex = 8;
- this.button8.Text = "-";
- this.button8.UseVisualStyleBackColor = true;
- //
- // button9
- //
- this.button9.Location = new System.Drawing.Point(280, 91);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(75, 23);
- this.button9.TabIndex = 9;
- this.button9.Text = "%";
- this.button9.UseVisualStyleBackColor = true;
- //
- // button10
- //
- this.button10.Location = new System.Drawing.Point(280, 62);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(75, 23);
- this.button10.TabIndex = 10;
- this.button10.Text = "cos";
- this.button10.UseVisualStyleBackColor = true;
- //
- // button11
- //
- this.button11.Location = new System.Drawing.Point(361, 179);
- this.button11.Name = "button11";
- this.button11.Size = new System.Drawing.Size(75, 23);
- this.button11.TabIndex = 11;
- this.button11.Text = "6";
- this.button11.UseVisualStyleBackColor = true;
- //
- // button12
- //
- this.button12.Location = new System.Drawing.Point(361, 150);
- this.button12.Name = "button12";
- this.button12.Size = new System.Drawing.Size(75, 23);
- this.button12.TabIndex = 12;
- this.button12.Text = "3";
- this.button12.UseVisualStyleBackColor = true;
- //
- // button13
- //
- this.button13.Location = new System.Drawing.Point(361, 121);
- this.button13.Name = "button13";
- this.button13.Size = new System.Drawing.Size(75, 23);
- this.button13.TabIndex = 13;
- this.button13.Text = "+";
- this.button13.UseVisualStyleBackColor = true;
- //
- // button14
- //
- this.button14.Location = new System.Drawing.Point(361, 91);
- this.button14.Name = "button14";
- this.button14.Size = new System.Drawing.Size(75, 23);
- this.button14.TabIndex = 14;
- this.button14.Text = "/";
- this.button14.UseVisualStyleBackColor = true;
- //
- // button15
- //
- this.button15.Location = new System.Drawing.Point(203, 179);
- this.button15.Name = "button15";
- this.button15.Size = new System.Drawing.Size(75, 23);
- this.button15.TabIndex = 15;
- this.button15.Text = "4";
- this.button15.UseVisualStyleBackColor = true;
- //
- // button16
- //
- this.button16.Location = new System.Drawing.Point(203, 208);
- this.button16.Name = "button16";
- this.button16.Size = new System.Drawing.Size(75, 23);
- this.button16.TabIndex = 16;
- this.button16.Text = "7";
- this.button16.UseVisualStyleBackColor = true;
- //
- // button17
- //
- this.button17.Location = new System.Drawing.Point(280, 208);
- this.button17.Name = "button17";
- this.button17.Size = new System.Drawing.Size(75, 23);
- this.button17.TabIndex = 17;
- this.button17.Text = "8";
- this.button17.UseVisualStyleBackColor = true;
- //
- // button18
- //
- this.button18.Location = new System.Drawing.Point(361, 208);
- this.button18.Name = "button18";
- this.button18.Size = new System.Drawing.Size(75, 23);
- this.button18.TabIndex = 18;
- this.button18.Text = "9";
- this.button18.UseVisualStyleBackColor = true;
- //
- // button19
- //
- this.button19.Location = new System.Drawing.Point(203, 237);
- this.button19.Name = "button19";
- this.button19.Size = new System.Drawing.Size(75, 23);
- this.button19.TabIndex = 19;
- this.button19.Text = "T";
- this.button19.UseVisualStyleBackColor = true;
- //
- // button20
- //
- this.button20.Location = new System.Drawing.Point(280, 237);
- this.button20.Name = "button20";
- this.button20.Size = new System.Drawing.Size(75, 23);
- this.button20.TabIndex = 20;
- this.button20.Text = "0";
- this.button20.UseVisualStyleBackColor = true;
- //
- // button21
- //
- this.button21.Location = new System.Drawing.Point(361, 237);
- this.button21.Name = "button21";
- this.button21.Size = new System.Drawing.Size(75, 23);
- this.button21.TabIndex = 21;
- this.button21.Text = "=";
- this.button21.UseVisualStyleBackColor = true;
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(481, 264);
- 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.textBox1);
- this.Name = "Form1";
- this.Text = "Form1";
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- }
- #endregion
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button5;
- private System.Windows.Forms.Button button6;
- private System.Windows.Forms.Button button7;
- private System.Windows.Forms.Button button8;
- private System.Windows.Forms.Button button9;
- private System.Windows.Forms.Button button10;
- private System.Windows.Forms.Button button11;
- private System.Windows.Forms.Button button12;
- private System.Windows.Forms.Button button13;
- private System.Windows.Forms.Button button14;
- private System.Windows.Forms.Button button15;
- private System.Windows.Forms.Button button16;
- private System.Windows.Forms.Button button17;
- private System.Windows.Forms.Button button18;
- private System.Windows.Forms.Button button19;
- private System.Windows.Forms.Button button20;
- private System.Windows.Forms.Button button21;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement