ContainerControl.ValidateChildren Method (ValidationConstraints)
Assembly: System.Windows.Forms (in system.windows.forms.dll)
public boolean ValidateChildren ( ValidationConstraints validationConstraints )
public function ValidateChildren ( validationConstraints : ValidationConstraints ) : boolean
Not applicable.
Parameters
- validationConstraints
Tells ValidateChildren how deeply to descend the control hierarchy when validating the control's children.
Return Value
true if all of the children validated successfully; otherwise, false. If called from the Validating or Validated event handlers, this method will always return false.ValidateChildren will examine all the children of the current control, causing the Validating event to occur on a control if it meets the criteria spelled out by ValidationConstraints.
You may use several ValidationConstraints parameters at once by combining them with a bitwise OR operator.
Regardless of which parameters you specify for this method, a control must have its CausesValidation property set to true in order for its Validating event to occur. You should also set the AutoValidate property of the control or of the control's container to false if you want validation to happen only when you call ValidateChildren, and not when the user shifts focus from the control.
If a control is bound to a data source, and the Validating event occurs, it will cause the control to push its current data back to the data source.
You cannot achieve the opposite effect of a ValidationConstraints parameter by applying a bitwise negation operator. For example, if you supply the negative value of the Visible field to ValidateChildren, it will not validate all children that are not visible on the container. Supplying any negative parameter to ValidateChildren will have no effect on the container or its children.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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.