How can I make my textbox accept only the 0 and the 1. Or only accept a character. This is the code I have.
private void press(object sender, KeyPressEventArgs e)
{
if (Char.IsLetter(e.KeyChar))
{
e.Handled = true;
}
if (Char.IsNumber(e.KeyChar))
{
e.Handled = false;
}
}
The one who can help me, thank you.