here it is.. |
| santhosh kapa replied to divya rocks at 12-May-08 02:52 |
You can do this in the Key_Press event of that particular TextBox in which you want to enters only the a-z.
Use this code in the keypress event
int ascii = Convert.ToInt16(e.KeyChar);
if ((ascii >= 97 && ascii <= 122) || (ascii == 8))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
Ascii values of "a" to "z" is 97 to 122. And 8 is ascii vaue of Backspace is used to delete the characters using backspace. |
|