private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < '0' || e.KeyChar > '9')
if (e.KeyChar != '\b')
e.Handled = true;
}
i am not understanding how this code is not allowing anything except backspace and numbers.
- the first if statement is saying if it is not 0 - 9 then dont do anything?
- the second one is saying if it's not backspace dont do anything?
- what does
e.Handled=Truedo?