System.Windows.Forms.AutoValidate Enumeration

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


public enum AutoValidate


If a user switches focus off of a Windows Forms control, the control will use System.Windows.Forms.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 ContainerControl.Validate or ContainerControl.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 (Windows Forms).


Member NameDescription

Implicit validation will not occur. Setting this value will not interfere with explicit calls to ContainerControl.Validate or ContainerControl.ValidateChildren.


Implicit validation occurs, but if validation fails, focus will still change to the new control. If validation fails, the Control.Validated event will not fire.


Implicit validation occurs when the control loses focus.


The control inherits its System.Windows.Forms.AutoValidate behavior from its container (such as a form or another control). If there is no container control, it defaults to AutoValidate.EnablePreventFocusChange.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions:
Since: .NET 2.0