Monday, September 16, 2013

Calculate the subtraction of two Integer numbers in a Windows Forms Application

The Form i made : 




It includes 5 Labels, 3 TextBoxes, and 1 button , i named the first TextBox : TxtFirstNumber, the second TextBox  TxtSecondNumber, the third TextBox : TxtOutput, the Button : BtnCalculate 


The Calculate Button Code : 

        private void BtnCalculate_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(TxtFirstNumber.Text);
            int b = Convert.ToInt32(TxtSecondNumber.Text);
            TxtOutput.Text = Convert.ToString(a - b);
        }

Example : 



No comments :

Post a Comment