Reputation: 8384
I intend to have a TextEdit
that can have a maximum 4 digit length positive number.
I use the following TextEdit
:
<dxe:TextEdit Name="txtNumber" Mask="\d+{0,4}" MaskType="RegEx" />
I can put exactly 10 digits in it without any sign of overflow. After that I can put more numbers, the TextEdit
turns red but keeps letting me to add more digits.
What should I use to stop the user at 4 digits without using some code-behind magic?
Upvotes: 1
Views: 642
Reputation: 6621
You can use numeric mask type with ####;
as mask:
<dxe:TextEdit Name="txtNumber" Mask="####;" MaskType="Numeric"/>
Upvotes: 2