3

Iam using Masked Text box for inputing a Date. But I want to set custom date format for this text box. How can I set custom date format and validate date on masked text box control

Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138

1 Answers1

3

I believe you should use a DateTime Picker for getting such inputs (i think you want it to avoid the mouse probably)

least you can set a mask like 00/00/0000 and later on subscribe for the Validating event of the maskedtextbox and use Parse or ParseExact to verfiy the Date entered.

In case you want to have blank for date picker then check out this solution remove date

Community
  • 1
  • 1
V4Vendetta
  • 37,194
  • 9
  • 78
  • 82