I want to add a number to a TextBox
by generating a number when the user clicks the "+" button and subtracts when clicking "-". For example: the random number was 2. If I click on the +, it appears 3. If I click on -, the 1 appears.
It seems that you can not do add and subtract type operations with TextBox
s, as in this code here, that the CS00019 error was displayed:
private void btn_plus_Click(object sender, EventArgs e)
{
resultado.Text = resultado + 1;
}
Where resultado.Text
is the number converted to string and resultado
the name of my TextBox
.
How could I make it work?