This is my code:
private void txtAdd_KeyPress(object sender, KeyPressEventArgs e) { if (!(char.IsLetter(e.KeyChar)) && !(char.IsNumber(e.KeyChar)
From the documentation:
The KeyPress event is not raised by noncharacter keys; however, the noncharacter keys do raise the KeyDown and KeyUp events.