Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i need the code in C# to make a textbox which accepts only numbers???
plz.
Posted
Updated 21-Jan-10 5:25am
v3

Are you entering a contest for stupid people ? How is your name a useful subject line ? Why is it that google does not work where you live ? Any of these[^] hits will do fine, I am sure.
 
Share this answer
 
You may use an NumericUpDown instead.
 
Share this answer
 
Handle the TextChanged event for the textbox, and eliminate anything in the TextBox.Text property that's not a numeric digit.
 
Share this answer
 
v2
You seem to confuse the text field labeled "Question" with "Enter your name here". For six times in a row. Wow! :omg:

The funny thing is, viewing your user profile and the googling for "kiu pakistan" finds "Karakoram International University, Northern Areas, Gilgit, Pakistan". Maybe somebody should send them an email, describing what a lazy prat ehsan assu is?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900