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.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace hello
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void Form1_Load_1(object sender, EventArgs e)
- {
- comboBox1.Items.Add("+");
- comboBox1.Items.Add("-");
- comboBox1.Items.Add("*");
- comboBox1.Items.Add("/");
- Update();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int val1 = int.Parse(textBox1.Text);
- int val2 = int.Parse(textBox2.Text);
- if (comboBox1.SelectedItem == "+")
- {
- textBox3.Text = (val1 + val2).ToString();
- }
- else if (comboBox1.SelectedItem == "-")
- {
- textBox3.Text = (val1 - val2).ToString();
- }
- else if (comboBox1.SelectedItem == "*")
- {
- textBox3.Text = (val1 * val2).ToString();
- }
- else if (comboBox1.SelectedItem == "/")
- {
- textBox3.Text = (val1 / val2).ToString();
- }
- }
- private void label5_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Copyright (c) 2013 Touhid\n \nWebsite: www.touhid.info", "Copyright");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement