Net Regular Expressions Remove HTML Tags from String using . NET Regular Expression to Check MAC Address Regular Expression to Check Zip Code Validate e Mail Addresses using VB.
In this article, I will discuss how to create a Masked Text Box control in Windows Forms at design-time as well as run-time.
After that, I will continue discussing various properties and methods available for the Masked Text Box control.
Each editable mask position, representing a required or optional input, is shown with a single prompt character.
Using the Mask property, you can specify the following input without writing any custom validation logic in your application: control is displayed at run time, it represents the mask as a series of prompt characters and optional literal characters.
NET Tips and Tricks, C# Tips & Tricks, Visual Studio 2010, . NET Tips & Tricks The Masked Text Box class is an enhanced Text Box control that supports a declarative syntax for accepting or rejecting user input.
You can use the Prompt Char property to specify a custom prompt character.
The Hide Prompt On Leave property determines if the user sees the prompt characters when the control loses input focus.
As the user types input into the masked text box, valid input characters replace their respective prompt characters in a sequential fashion.
If the user types an invalid input character, no replacement occurs, but instead a beep is issued if the Beep On Error property is set to true, and the Mask Input Rejected event is raised.
You can provide your own custom error logic by handing this event.
If a character other than the prompt character is typed, the literal will automatically be skipped and the input character will be applied to the next editable position, represented by the next prompt character.
Masks do not necessarily guarantee that a user's input will represent a valid value for a given type; for example, -9 could be entered for an age in years.
You can verify that a user's input represents a valid value by assigning an instance of that value's type to the See Also Extract Ref Links From Web Page using VB. NET Regular Expression to Check Email Addresses VB.