key press event in .net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am developing an application in .net. I have various textboxes on the
forms and need to include data validation, or at least restrict the users
input. How do I go about allowing only letters to be entered into a textbox
using the above mentioned event? Further, I want to allow only numbers and
letters to be entered in. I don't want to enter in e.keychar="!" orelse
e.keychar=">", etc. I have converted the contents to uppercase already.

Thanks,
Dave
 
dave said:
I am developing an application in .net. I have various textboxes on the
forms and need to include data validation, or at least restrict the users
input. How do I go about allowing only letters to be entered into a textbox
using the above mentioned event? Further, I want to allow only numbers and
letters to be entered in. I don't want to enter in e.keychar="!" orelse
e.keychar=">", etc. I have converted the contents to uppercase already.

Char.IsLetterOrDigit()
 
Dave,

In addition to Jon, I use forever for this kind of operations the Key up to
get as much as posible possibilities from the eventargument.

I hope this helps,

Cor
 
Back
Top