Are you using the Keypress event? You can use "e.Handled = True" do cancel the key.
>Good afternoon! Just would like to know how to filter keys pressed when focus is set on a TextBox control. Like I would like to prevent the user from entering characters, other than alphabets, on a textbox. Right now I am able to clean it out after the control looses the focus. In VB6 it was possible to validate the key pressed by the user and prevent it from being displayed. But the system variable e.KeyValue is read-only. Therefore, I can not set it to NULL.
>
>Any ideas on how I can achieve this?
>
>Thanx! in advance...
>
>Martin
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com