dotnetmonitor.com

 
Index
Previous
Next

 

Use the MaskedTextBox's TypeValidationCompleted event. This event occurs when the MaskedTextBox loses focus and the static Parse method on the Type set into the ValidatingType proeprty is called.

 

The IsValidInput property on the TypeValidationEventArgs returns true if the Parse method succeeded. The ReturnValue property on the TypeValidationEventArgs returns the instance created by the Parse method.

 

You can then use the DateTime.Compare method to verify the DateTime is within a range.

How do I data bind to a MaskedTextBox?
How do I make the MaskedTextBox always overwrite like in Access?
How can I tell if the MaskedTextBox is in insert mode?
How can I access the pre-defined masks from other cultures?
How can I create a custom mask type that shows up in the Mask picker dialog in VS?