You are on page 1of 3

C:\Users\Sundeep\Documents\Visual Studio ...\caluculator\caluculator\Caluculator.cs 1 using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.

Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms;

namespace caluculator { public partial class Caluculator : Form { public Caluculator() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 1; textBox1.Text = str1 + j.ToString(); } private void button2_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j=2; textBox1.Text = str1 + j.ToString(); } private void button3_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j=3; textBox1.Text = str1 + j.ToString(); } private void button4_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 4; textBox1.Text = str1 + j.ToString(); } private void button5_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 5; textBox1.Text = str1 + j.ToString(); } private void button6_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 6; textBox1.Text = str1 + j.ToString(); } private void button7_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 7; textBox1.Text = str1 + j.ToString(); }

C:\Users\Sundeep\Documents\Visual Studio ...\caluculator\caluculator\Caluculator.cs 2 private void button8_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 8; textBox1.Text = str1 + j.ToString(); } private void button9_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 9; textBox1.Text = str1 + j.ToString(); } private void button11_Click(object sender, EventArgs e) { string str1 = textBox1.Text; int j = 0; textBox1.Text = str1 + j.ToString(); } private void button10_Click(object sender, EventArgs e) { label1.Text = textBox1.Text; textBox1.Text = null; label2.Text = "*"; label3.Text = "?"; } private void button12_Click(object sender, EventArgs e) { label1.Text = textBox1.Text; textBox1.Text = null; label2.Text = "+"; label3.Text = "?"; } private void button13_Click(object sender, EventArgs e) { label1.Text = textBox1.Text; textBox1.Text = null; label2.Text = "-"; label3.Text = "?"; } private void button14_Click(object sender, EventArgs e) { label3.Text = textBox1.Text; float b = Single.Parse(label3.Text); if (label2.Text == "*") { float a = Single.Parse(label1.Text); float mul = a * b; textBox1.Text = mul.ToString(); } else if (label2.Text == "+") { float a = Single.Parse(label1.Text); float add = a + b; textBox1.Text = add.ToString(); } else if (label2.Text == "-") { float a = Single.Parse(label1.Text); float sub = a - b;

C:\Users\Sundeep\Documents\Visual Studio ...\caluculator\caluculator\Caluculator.cs 3 textBox1.Text = sub.ToString(); } else if (label2.Text == "/") { float a = Single.Parse(label1.Text); float div = a / b; textBox1.Text = div.ToString(); } } private void label1_Click(object sender, EventArgs e) { label1.Text = textBox1.Text; } private void button15_Click(object sender, EventArgs e) { textBox1.Text = null; label1.Text = "*"; label2.Text = "*"; label3.Text = "*"; } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button16_Click(object sender, EventArgs e) { string str1 = textBox1.Text; } textBox1.Text = str1 + "." ;

private void button17_Click(object sender, EventArgs e) { label1.Text = textBox1.Text; textBox1.Text = null; label2.Text = "/"; label3.Text = "?"; } } }

You might also like