using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace calculator { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void AC (object sender, EventArgs e) { textBox1.Text = ""; } private void = (object sender, EventArgs e) { DataTable dt = new DataTable(); textBox1.Text = dt.Compute(textBox1.Text, "").ToString(); } private void 1 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "1"; } private void 2 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "2"; } private void 3 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "3"; } private void 4 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "4"; } private void 5 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "5"; } private void 6 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "6"; } private void 7 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "7"; } private void 8 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "8"; } private void 9 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "9"; } private void 0 (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "0"; } private void . (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "."; } private void + (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "+"; } private void - (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "-"; } private void * (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "*"; } private void / (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "/"; } private void % (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "%"; } private void +/- (object sender, EventArgs e) { textBox1.Text = textBox1.Text + "+/-"; } } }