Spread Windows Forms 6.0 Product Documentation
IsValid Method
See Also  Example Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : IsValid Method


Glossary Item Box

Gets whether the contents of the control are valid.

Syntax

Visual Basic (Declaration) 
Public Overridable Function IsValid() As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SuperEditBase
Dim value As Boolean
 
value = instance.IsValid()
C# 
public virtual bool IsValid()

Return Value

true if the contents of the control are valid; false otherwise

Remarks

Use this method to check whether the contents of a control are valid. If the method returns true, the contents are valid.

Usually, when the InvalidOption property is set to InvalidOption.ClearData, the IsValid property returns true because the invalid data has been cleared.

Example

C#Copy Code
privatevoidForm1_Load(objectsender,System.EventArgse)
{
control.Text="Hi";
control.InvalidOption=FarPoint.Win.InvalidOption.ShowData;
}

privatevoidcontrol_MouseDown(objectsender,System.Windows.Forms.MouseEventArgse)
{
boolbvalue;
bvalue=control.IsValid();
if(bvalue==false)
{
control.Value=500;
}
}
Visual BasicCopy Code
PrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
control.Text="Hi"
control.InvalidOption=FarPoint.Win.InvalidOption.ShowData
EndSub

PrivateSubcontrol_MouseDown(ByValsenderAsObject,ByValeAsSystem.Windows.Forms.MouseEventArgs)HandlesCurrency1.MouseDown
DimbvalueAsBoolean
bvalue=control.IsValid()
Ifbvalue=FalseThen
control.Text=500
EndIf
EndSub

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.