5
I’m trying to do the following: if the guess value (_TextValPalite
) is enabled then it will check that this number is not different from a minimum value and a maximum value.
Ex: between 1 and 10 I can write 5, but not 11.
if(_TextValPalite.Enabled)
{
if (Convert.ToInt32(_TextValMin.Text) & Convert.ToInt32(_TextValMax.Text) != Convert.ToInt32(_TextValPalite.Text))
{
MessageBox.Show("Você não pode fazer isso");
return;
}
}
But it returns this error:
Operator '&' cannot be applied to operands of type 'int' and 'bool'
I can do + - * / operations normally, but how to do the bool
interpret this? turning it into a int
? how could I do that?
Did any of the answers solve your problem? Do you think you can accept one of them? If you haven’t already, see [tour] how to do this. You would help the community by identifying the best solution for you. You can only accept one of them, but you can vote for any question or answer you find useful on the entire site.
– Maniero