Windows forms - textbox that accepts specific timestamp format
How can I add a masked textbox in Windows forms that accepts开发者_如何转开发 datetime in the following format:
01/01/1993 12:00 AM
There is a better way to solove this using DateTimePicker
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "MM/dd/yyyy HH:mm";
Best that can be done with MaskedTextbox is by setting following Mask
maskedTextBox1.Mask = "00/00/0000 00:00 AM"
Then again all of the validations have to be hand written by you.
According MS specification from here, you cannot specify such format. The most nearest meaning mask for your request would be 00\/00\/0000 90:00 \AM
精彩评论