Export (0) Print
Expand All
Expand Minimize

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)

type AutoValidate

Member nameDescription
DisableImplicit validation will not occur. Setting this value will not interfere with explicit calls to Validate or ValidateChildren.
EnableAllowFocusChangeImplicit validation occurs, but if validation fails, focus will still change to the new control. If validation fails, the Validated event will not fire.
EnablePreventFocusChangeImplicit validation occurs when the control loses focus.
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.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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.

Show:
© 2014 Microsoft