System.Windows.Forms.AutoValidate Enumeration

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

Syntax

public enum AutoValidate

Remarks

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).

Members

Member NameDescription
Disable

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

EnableAllowFocusChange

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.

EnablePreventFocusChange

Implicit validation occurs when the control loses focus.

Inherit

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.

Requirements

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