I have the following code to only allow letters in the text box:
private void TextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
Char pressedKey = e.KeyChar;
if (Char.IsLetter(pressedKey))
{
// Allow input.
e.Handled = false
}
else
e.Handled = true;
}
}
How can I allow the backspace key to work because, it doesnt let me to delete characters after typed