-1
I’m trying to make a very simple calculator, just to understand how the program works, and I came across the following problem:
If I put 5+5 in the calculator it gives me the value of 55 as a response. To fix this I tried to pass the values typed to int
, but always gives the error:
Cannot implicitly Convert type 'int' to 'string'
private void BtnSoma_Click(object sender, EventArgs e)
{
lblResultado.Text = Convert.ToInt32(txtNum1.Text) + Convert.ToInt32(txtNum2.Text);
}