Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Key validation in Winform

Posted on 2007-03-20
3
698 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 70

Expert Comment

by:Éric Moreau
ID: 18760641
0
 
LVL 9

Assisted Solution

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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