Integer Example

Description :
In this example, User can insert two numbers in texboxes and when it will click on button1, A messagebox window will appear with result.

Ingredients:
1) Two Textboxes
2) One Button
3) One MessageBox

Programming :

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 WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int a;
            int b;
            int c;
            a = int.Parse(textBox1.Text);
            b = int.Parse(textBox2.Text);
            c = a + b;
            MessageBox.Show(c.ToString());
        }
    }
}


( Before )


( After )

No comments:

Post a Comment