0

have to set range for my textbox at runtime .the range should be be >=25 to <=50. what should I use in WPF so that if user enters value out of range then another textbox shows the incorrect range msg

I have tried some property but it is not accepting the range ......it is just giving the error msg on changing the default value

but I want to show the msg only when the range is less than 25 and greater than 50

  • I'm afraid that there is no simple setting for this in the TextBox properties. One way is to first teach your textbox to accept only numbers. And then implement your condition in code. https://stackoverflow.com/questions/1268552/how-do-i-get-a-textbox-to-only-accept-numeric-input-in-wpf Another solution are validators: https://stackoverflow.com/questions/19539492/implement-validation-for-wpf-textboxes – Viliam Dec 19 '22 at 10:12

0 Answers0