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

MaskedTextBox.ValidateText Method

Converts the user input string to an instance of the validating type.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public Object ValidateText ()
public Object ValidateText ()
public function ValidateText () : Object
Not applicable.

Return Value

If successful, an Object of the type specified by the ValidatingType property; otherwise, a null reference (Nothing in Visual Basic) to indicate conversion failure.
Exception typeCondition

Exception

A critical exception occurred during the parsing of the input string.

The ValidateText method attempts to convert the formatted string contained in the Text property to an instance of the type that is specified by the ValidatingType property. Prompt characters are ignored in the formatted string, but literals are handled in accordance with the current value of the TextMaskFormat property.

ValidateText raises the TypeValidationCompleted event after the conversion is attempted, regardless of its success.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.