Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MaskedTextProvider.VerifyChar Method

Tests whether the specified character could be set successfully at the specified position.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)
public bool VerifyChar(
	char input,
	int position,
	out MaskedTextResultHint hint


Type: System.Char

The Char value to test.

Type: System.Int32

The position in the mask to test the input character against.

Type: System.ComponentModel.MaskedTextResultHint

A MaskedTextResultHint that succinctly describes the result of the operation. An output parameter.

Return Value

Type: System.Boolean
true if the specified character is valid for the specified position; otherwise, false.

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.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.