I have an issue with a small piece of code I've made.
For the code I have to make a small check. When the value of _mmdTextBox
is bigger then 1999 it should give a MessageBx.Show("Value to high")
.
If the value is smaller then 0 there should be a MessageBox.Show("Value to low")
.
This is what I have made so far:
private void _mmdButton_Click(object sender, EventArgs e)
{
var value = _mmdTextBox.Text;
if (value > 1999 && value < 0)
{
MessageBox.Show("Value is to high");
}
else
{
// action
}
}
This is the error that I get when I do it like the code above:
Error 1 Operator '>' cannot be applied to operands of type 'string' and 'int'