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