You are on page 1of 4

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.

Text; using System.Threading.Tasks; using System.Windows.Forms; namespace combocalculator { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int firstno = Int32.Parse(firstnumbertextbox.Text); int secondno = Int32.Parse(secondnumbertextbox.Text); int sum = firstno + secondno; resulttextbox.Text = sum.ToString(); label1.Text = "Your calculation was successfull and below is your an swer"; label1.BackColor = Color.Aqua; label1.ForeColor = Color.Gold; } private void button2_Click(object sender, EventArgs e) { int firstno = Int32.Parse(firstnumbertextbox.Text); int secondno = Int32.Parse(secondnumbertextbox.Text); int difference = firstno - secondno; resulttextbox.Text = difference.ToString(); label1.Text = "Your calculation was successfull and below is your an swer"; label1.BackColor = Color.Aqua; label1.ForeColor = Color.Gold; } private void button5_Click(object sender, EventArgs e) { double firstno = Double.Parse(firstnumbertextbox.Text); double secondno = Double.Parse(secondnumbertextbox.Text); double division = firstno / secondno; resulttextbox.Text = division.ToString(); label1.Text = "Your calculation was successfull and below is your an swer"; label1.BackColor = Color.Aqua; label1.ForeColor = Color.Gold; } private { int int int void button4_Click(object sender, EventArgs e) firstno = Int32.Parse(firstnumbertextbox.Text); secondno = Int32.Parse(secondnumbertextbox.Text); multiplication = firstno * secondno;

resulttextbox.Text = multiplication.ToString(); label1.Text = "Your calculation was successfull and below is your an swer"; label1.BackColor = Color.Aqua; label1.ForeColor = Color.Gold; } private void button3_Click(object sender, EventArgs e) { firstnumbertextbox.Clear(); secondnumbertextbox.Clear(); resulttextbox.Clear(); } private void operationcombobox1_SelectedIndexChanged(object sender, Even tArgs e) { if (operationcombobox.SelectedIndex { addbutton.PerformClick(); } if (operationcombobox.SelectedIndex { subtractbutton.PerformClick(); } if (operationcombobox.SelectedIndex { multiplybutton.PerformClick(); } if (operationcombobox.SelectedIndex { dividebutton.PerformClick(); } if (operationcombobox.SelectedIndex { clearbutton.PerformClick(); } } private void Form1_Load(object sender, EventArgs e) { addbutton.Enabled = false; subtractbutton.Enabled = false; multiplybutton.Enabled = false; dividebutton.Enabled = false; clearbutton.Enabled = false; } private void firstnumbertextbox_TextChanged(object sender, EventArgs e) { } private void secondnumbertextbox_TextChanged(object sender, EventArgs e) { if (firstnumbertextbox.Text != "" && secondnumbertextbox.Text != "") { addbutton.Enabled = true; subtractbutton.Enabled = true; == 0)

== 1)

== 2)

== 3)

== 4)

multiplybutton.Enabled = true; dividebutton.Enabled = true; clearbutton.Enabled = true; } else { addbutton.Enabled = false; subtractbutton.Enabled = false; multiplybutton.Enabled = false; dividebutton.Enabled = false; clearbutton.Enabled = false; } } private void numericUpDown1_ValueChanged(object sender, EventArgs e) { } private void button2_Click_1(object sender, EventArgs e) { decimal firstno = (firstnumbernumericUpDown.Value); decimal secondno = (secondnumbernumericUpDown.Value); decimal sum = firstno + secondno; resulttextbox.Text = sum.ToString(); districtlabel.Text = "Your home district is " + countrydomainlookup. SelectedItem.ToString(); } private void countrydomainlookup_SelectedItemChanged(object sender, Even tArgs e) { } private void button3_Click_1(object sender, EventArgs e) { decimal firstno = (firstnumbernumericUpDown.Value); decimal secondno = (secondnumbernumericUpDown.Value); decimal difference = firstno - secondno; resulttextbox.Text = difference.ToString(); districtlabel.Text = "Your home district is " + countrydomainlookup. SelectedItem.ToString(); } private void button1_Click_1(object sender, EventArgs e) { decimal firstno = (firstnumbernumericUpDown.Value); decimal secondno = (secondnumbernumericUpDown.Value); decimal multiply = firstno * secondno; resulttextbox.Text = multiply.ToString(); districtlabel.Text = "Your home district is " + countrydomainlookup. SelectedItem.ToString(); } private void button4_Click_1(object sender, EventArgs e) { decimal firstno = (firstnumbernumericUpDown.Value); decimal secondno = (secondnumbernumericUpDown.Value);

decimal division = firstno / secondno; resulttextbox.Text = division.ToString(); districtlabel.Text = "Your home district is " + countrydomainlookup. SelectedItem.ToString(); } } }