Export (0) Print
Expand All

ContainerControl.Validate Method (Boolean)

Verifies the value of the control that is losing focus; conditionally dependent on whether automatic validation is turned on.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public:
bool Validate (
	bool checkAutoValidate
)
public boolean Validate (
	boolean checkAutoValidate
)
public function Validate (
	checkAutoValidate : boolean
) : boolean
Not applicable.

Parameters

checkAutoValidate

If true, the value of the AutoValidate property is used to determine if validation should be performed; if false, validation is unconditionally performed.

Return Value

true if validation is successful; otherwise, false. If called from the Validating or Validated event handlers, this method will always return false.

The Validate method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version performs validation based on the following conditions:

  • If the checkAutoValidate parameter is true, validation always occurs for child controls that are not validated.

  • If the checkAutoValidate parameter is false, validation occurs only if the AutoValidate property of the control's parent is enabled.

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.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft