Tuesday, April 8, 2014

Basic Window Application Form


namespace BasicWinApp
{


    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            double n1 = double.Parse(txtBox1.Text);
            double n2 = double.Parse(txtBox2.Text);
            double result = n1 + n2;
            txtResult.Text = result.ToString();
        }

        private void btnMultiply_Click(object sender, EventArgs e)
        {
            double n1 = double.Parse(txtBox1.Text);
            double n2 = double.Parse(txtBox2.Text);
            double result = n1 * n2;
            txtResult.Text = result.ToString();
        }

        private void btnDivide_Click(object sender, EventArgs e)
        {
            double n1 = double.Parse(txtBox1.Text);
            double n2 = double.Parse(txtBox2.Text);
            double result = n1 / n2;
            txtResult.Text = result.ToString();
        }
    }
}

No comments:

Post a Comment