Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to restrict zeros in textbox
example

0000 like this..
textbox will not accept '0000'


plz help me....
Posted
Comments
John C Rayan 6-Mar-15 7:16am    
only 0000 but can accept other numbers? is it web? Did you try jquery?
devchina 6-Mar-15 7:23am    
textbox will accept other numbers but owent accept 00000
i need this in vb code only
John C Rayan 6-Mar-15 9:03am    
well, then you use MaskedTextBox and set Mask as custom put [1-9]. This is only accept numbers. If you want to accept alphabets then add [a][1-9]. Better check with other Masking elements and apply them correctly according to your requirement

Never try to do such things! It will drive any users mad. "0000" is perfectly valid string representing zero, and strings like "0012" are also perfectly valid.

—SA
 
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