471,356 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

key press event in .net

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
Jul 22 '05 #1
2 1055
dave wrote:

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()

--

www.midnightbeach.com
Jul 22 '05 #2
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
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by guoqi zheng | last post: by
6 posts views Thread by Rado | last post: by
22 posts views Thread by Ricky W. Hunt | last post: by
1 post views Thread by donald | last post: by
1 post views Thread by =?Utf-8?B?QXNhZg==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.