I'm using Visual Studio 2005. The MaskedTextBox object has a property called SkipLiterals. The MSDN describes it as:
Gets or sets a value indicating whether the user is allowed to reenter literal values.
but gives no examples of what are literal characters and how to use the SkipLiterals property.
What are literal characters? Secondly, can anyone give me an example of how to use the SkipLiterals property of the MaskedTextBox?
Paul ChinPosted Sep 23, 2007, 6:03 AM
AlanPosted Sep 23, 2007, 5:19 AM
Literals are characters which do not have a special meaning within the Mask property of the MaskedTextBox. In other words any character apart from 0, 9, #, L, C etc. which are used to denote a specific kind of character in the mask. Literal characters simply appear as themselves when the mask is displayed.
The SkipLiterals property allows you to specify whether or not the user is allowed to re-enter such literals. If it's set to 'false', then the user cannot re-enter the literal but must enter the next editable character. If it's set to 'true' (the default), then the user has a choice whether to re-enter the literal or not.
There's actually a good example in the online MSDN docs:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.skipliterals.aspx