C maskedtextbox validating
This property is similar to Mask Completed property with the exception that it also encompasses optional inputs specified in the Mask property.
To compare these properties and to demonstrate their usefulness when it comes to validating, we will look at validating a phone number.
For licensed customers, use the forum associated with your product in our Product Support Forums for Registered Customers.
For users of trial versions, please post in our Trial Software Questions forum.
This event is also fired when the Valdiate Text method is called.
If you have questions about our products, please post in our support forum.
This property determines whether the string returned by the Text property includes literals and/or prompt characters.
Use the Text Mask Format if you need to modify the format of the string that is returned by the Text property of the Masked Text Box control.
For example, to set the Validating Type to a Date Time you will need to do the following: Again you need not set this property if you are using a predefined mask.
This property sets the string governing the input for this control. Use the Mask property to limit the textbox’s input to a specific format.
You can define your own custom mask or preferably select from a predefined set using the designer.
Note: The Validating Type property looks for a static method named “Parse” that must be present in the Type to validate the content.
Since the Date Time class has a Parse method, it is compatible: This method converts the user input string to an instance of the validating type.
Resulting Masked Text Box with Phone Number Mask: This property indicates whether the masked text box control raises the system beep for each user key stroke that it rejects.