Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one,

in our project we are using multiple text boxes with different validations.

example
textbox1 with only numerics
textbox2 with alpha numeric
textbox3 with email validation
textbox4 with date validation and date picker.


i want to devlep controls with different validation in bulit .
if i need only textbox with numerics i can drag and drop in to my application

any one guide me in this .


thanks
karthik
Posted
Updated 23-Oct-11 6:44am
v2

1 solution

Usually you can prevent any keys from being entered in a TextBox by Inheriting from a TextBox and overriding the OnKeyPress Method of a TextBox. Text box to accept only number[^] there is an example. Any other validation would work more or less the same.
For more advanced TextBoxes you might have to create a CompositeControl[^] or a CustomControl[^]. This can be quite a difficult and daunting task though.
 
Share this answer
 
v2

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