Solved

Key validation in Winform

Posted on 2007-03-20
3
695 Views
Last Modified: 2008-02-26
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.
0
Comment
Question by:AdibRahman77
3 Comments
 
LVL 25

Accepted Solution

by:
dstanley9 earned 25 total points
Comment Utility
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:

http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 
LVL 9

Assisted Solution

by:sun4sunday
sun4sunday earned 25 total points
Comment Utility
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now