Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

AutoValidate Enumeration

Determines how a control validates its data when it loses user input focus.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
public enum class AutoValidate
Member nameDescription
DisableImplicit validation will not occur. Setting this value will not interfere with explicit calls to Validate or ValidateChildren.
EnablePreventFocusChangeImplicit validation occurs when the control loses focus.
EnableAllowFocusChangeImplicit validation occurs, but if validation fails, focus will still change to the new control. If validation fails, the Validated event will not fire.
InheritThe control inherits its AutoValidate behavior from its container (such as a form or another control). If there is no container control, it defaults to EnablePreventFocusChange.

If a user switches focus off of a Windows Forms control, the control will use AutoValidate to determine how to validate its data. This type of validation is called implicit validation, because it occurs without the application developer having to make an explicit call to Validate or ValidateChildren.

The property corresponding to this value will have different defaults based on the type of control. For more information, see User Input Validation in Windows Forms.

The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.