Home > DeveloperSection > Forums > How to make a text box to accept only number based on a condition?
Ankit Singh

Total Post:341

Points:2389
Posted on    September-23-2013 3:36 AM

 WPF WPF 
Ratings:


 1 Reply(s)
 625  View(s)
Rate this:

How to make a textbox to accept only number? when my label.text is gms or rs or knot, then respective textbox accept only numbers. when label.text is character it has allow only character value.

Example:gms: 1200

        character:black

        knot:5

        rs:80

        character:pink

Thanks in advance.



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    September-23-2013 6:48 AM

Hi Ankit,

Apply a regular validator on your text box with validation expression "^[0-9]" which accept only numbers initially make it disabled

you can then enable disable it according to the text of your label making the text box to accept all or only numbers.


Don't want to miss updates? Please click the below button!

Follow MindStick