SEARCH C# PROGRAMMING CODES HERE

Addition for multiple Textbox value in c # visual studio.

Addition for multiple textbox value in c# 
For example, add three textboxes and one button from the toolbox and then go to the button1 click event and copy the following code.

         private void button1_Click(object sender, EventArgs e)
        {
            int a = 0;
            int b = 0;
            int c = 0;

            if (int.TryParse(textBox1.Text, out a) & int.TryParse(textBox2.Text, out b))

            {
                c = a + b;
                textBox3.Text = c.ToString();
            }
        }

No comments:

Post a Comment