Search code examples
c#winformsmaskedtextbox

Why Masked Textbox Not Working 00-00-1900?


I am new to WinForms.

When I am trying to implement the masked text box, I got one error.

I want a mask of 00-00-1900 where 00 handle any number, but 19 is fixed and cannot be overwritten by the user. How do I do that?

Examples of valid input are 19-12-1988 and 12-01-1958.


Solution

  • 00-00-1900 in Mask Take --1___ Because 0 and 9 are the Masked text which refers, numeric.

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

    9 - Digit or space, optional.

    You Just Right Click The Masked Text Box, And Go to Property. Click and Change Mask to 00-00-1\900.

    You will get what you want.

    1900 to 1999 in 1900.