SEARCH C# PROGRAMMING CODES HERE

Multiplication for multiple textbox value in c# visual studio.

Multiplication 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