How to make a text box to accept only number based on a condition?

Total Post:341

Points:2389

WPF 
WPF
 1335  View(s)
Ratings:
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.

  1. Re: How to make a text box to accept only number based on a condition?

    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.

Answer

Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.