5
I want to add to a number in a TextBox
generating a digit when the user clicks the " + " button and subtracts when he clicks the " - ". For example: the random number was 2. If I click on +, 3 appears. If I click on -, 1 appears.
From the looks of it, you can’t do addition and subtraction operations with TextBox
es, as in this code here, which was presented the CS00019 error:
private void btn_plus_Click(object sender, EventArgs e)
{
resultado.Text = resultado + 1;
}
Where the resultado.Text
is the number converted into string and resultado
the name of my TextBox
.
How could I make it work?
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero