MaskedTextProvider.VerifyChar(Char, Int32, MaskedTextResultHint) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tests whether the specified character could be set successfully at the specified position.
public:
bool VerifyChar(char input, int position, [Runtime::InteropServices::Out] System::ComponentModel::MaskedTextResultHint % hint);
public bool VerifyChar (char input, int position, out System.ComponentModel.MaskedTextResultHint hint);
member this.VerifyChar : char * int * MaskedTextResultHint -> bool
Public Function VerifyChar (input As Char, position As Integer, ByRef hint As MaskedTextResultHint) As Boolean
Parameters
- position
- Int32
The position in the mask to test the input character against.
- hint
- MaskedTextResultHint
A MaskedTextResultHint that succinctly describes the result of the operation. An output parameter.
Returns
true
if the specified character is valid for the specified position; otherwise, false
.
Remarks
The VerifyChar method tests whether a single character value represents valid input at the specified position in the formatted string. This method will return false
for the following reasons:
The
pos
parameter is less than zero or greater than the Length of the Mask.The character
input
is not a valid input character, as determined by the IsValidInputChar method.The
input
is not compatible with the mask element at the specified position,pos
.
The last condition may depend on the current value of the AllowPromptAsInput, AsciiOnly, PasswordChar, PromptChar and SkipLiterals properties.
To test an entire input string against the mask, use one of the VerifyString methods instead.