I try to make program to add 7 number in C# window application
so I make 8 text box and one button for calculate
code :
private void button2_Click(object sender, EventArgs e)
{
string num1, num2, num3, num4, num5, num6, num7;
num1 = TextBox1.Text;
num2 = TextBox2.Text;
num3 = TextBox3.Text;
num4 = TextBox4.Text;
num5 = TextBox5.Text;
num6 = TextBox6.Text;
num7 = TextBox7.Text;
Convert.ToInt32(num1);
Convert.ToInt32(num2);
Convert.ToInt32(num3);
Convert.ToInt32(num4);
Convert.ToInt32(num5);
Convert.ToInt32(num6);
Convert.ToInt32(num7);
TextBox8.Text = num1 + num2 + num3 + num4 + num5 + num6 + num7;
}
but the problem is when I click the button the answer is = num1 num2 num3 num4 num5 num6 num7
which means no add happened.
Can any one explain why?

New Topic/Question
Reply




MultiQuote







|