-3

When I try to use a masked textbox in my project, I saw that 00000 and 99999 give the same result of _____ in my masked textbox.

Is 0 and 9 is the same in a mask of my masked textbox? If any difference: what are all that?

Please explain.

URL87
  • 10,667
  • 35
  • 107
  • 174
Sagotharan
  • 2,586
  • 16
  • 73
  • 117

3 Answers3

11

Take a look at the documentation of the Mask property:

Masking element     Description
---------------     -----------
0                   Digit, required.This element will accept any single digit between 0 and 9.
9                   Digit or space, optional. 

They're not the same, but every piece of the mask that is not a literal character to be included (like date or time separators or the dots in an IP address) will become an underscore to indicate that they are a place to enter stuff.

Joey
  • 344,408
  • 85
  • 689
  • 683
4

0 Digit, required. This element will accept any single digit between 0 and 9.

9 Digit or space, optional.

http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx

Community
  • 1
  • 1
CodesInChaos
  • 106,488
  • 23
  • 218
  • 262
0

000000 and 999999 has give the same __ in our WinForm. Don't Confuse. Its all refer the Same Digit. But You can use 0 is a must enter values like 00-00-0000 as date.

And 9 is ref Optional. like 999 as _96.

If you want use 0 and 9 as number in Masked Textbox,.. you can use \ before.