here's my code:
my question is, how can i prevent user to input integer values.Code:private void keypress_charOnly(object sender, KeyPressEventArgs e) { int ascii = Convert.ToInt16(e.KeyChar); if ((ascii >= 97 && ascii <= 122) || (ascii == 8) || (ascii >= 65 && ascii <= 90)) { e.Handled = false; } else { e.Handled = true; } }
copy and paste (using mouse) can bypass the keypress event..
thanks.




Reply With Quote