Key validation in Winform

Hi All,
I have textbox and I want the user enter only Numbers. Is there an event to do this in Winform like onkeypress and do the validation.
Basically I want him to Enable only numbers key on the keyboard for this textbox.
Who is Participating?
dstanley9Connect With a Mentor Commented:
In VS 2005 you can use the MaskedTextBox control.  In VS2003 you can use a TextBox and handle the OnKeyPress event.  Here's a samplt control that does this:
sun4sundayConnect With a Mentor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.