How can you make it so that only the numbers 1 or 2 can be entered into the textbox? And you can also use the Backspace key. The maximum length of textbox characters is one. I know how to enter only numbers:
char number = e.KeyChar;
if (!Char.IsDigit(number) && number != 8)
{
e.Handled = true;
}