Solved

Key validation in Winform

Posted on 2007-03-20
3
696 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
ID: 18759344
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
ID: 18760641
0
 
LVL 9

Assisted Solution

by:sun4sunday
sun4sunday earned 25 total points
ID: 18761619
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I need help embedding an image as HTML in my vb.net application 3 48
SlingPlayer alternatives 1 30
Authentication of Web Services 3 49
Server Error 11 47
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…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…

911 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

21 Experts available now in Live!

Get 1:1 Help Now