How to apply formatting string when binding DateTime to MaskedTextBox?
问题 I have a MaskedTextBox using the mask "00/00/\2\000" to restrict input to a format of XX/XX/20XX , with the Text property bound to MyBindingSource.SomeProperty of type DateTime . Recently, values with a single-digit month or day recently started displaying incorrectly. I expect that the ToString() method is being called on the value at some point in data binding, and I believe the call is not padding month / day with zeroes. I tried setting the format type of the MaskedTextBox.Text property