I need a control that only accept HEX value in the following format:
xxxx-xxxx and x is in 0-9, a-f, A-F
So I add a MaskedTextBox and try to edit its Mask property, but did not succeed.
See Question&Answers more detail:osI need a control that only accept HEX value in the following format:
xxxx-xxxx and x is in 0-9, a-f, A-F
So I add a MaskedTextBox and try to edit its Mask property, but did not succeed.
See Question&Answers more detail:osYou can't do this out of the box with a MaskedTextBox
. If you take a look at the allowed masking elements detailed at the documentation for the Mask
property, you'll see that there is no way that you can enforce only hexadecimal input.
You can use a NumericUpDown
and set its Hexadecimal
property to true
, though.