// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void SetGcDateValidatorDefaultSettings()
{
// Creates an instance of a GcDate control.
GcDate gcDate1 = new GcDate();
// Creates another instance of a GcDate control.
GcDate gcDate2 = new GcDate();
// Creates an instance of a GcDateValidator component.
GcDateValidator gcDateValidator1 = new GcDateValidator();
// Creates a LineNotify item for notifying validation mode by displaying a red line.
LineNotify lineNotify1 = new LineNotify();
// Creates a CompareControl object.
GcDateValidator.CompareControl compareControl1 = new GcDateValidator.CompareControl();
// Adds a ValidateAction object to the DefaultValidateActions.
gcDateValidator1.DefaultValidateActions.AddRange(new ValidateAction[] { lineNotify1 });
// Sets the ComparedControl to the comparedGcDate, the value of target control should compare with the value of this.
compareControl1.ComparedControl = gcDate2;
// Sets the ComparedOperator to the GreaterThanOrEquals. The value of target control should be greater than or equals
// with the value of the comparedGcDate.
compareControl1.ComparedOperator = ComparedOperator.GreaterThanOrEquals;
// Adds the compareControl to the DefaultValidateItems.
gcDateValidator1.DefaultValidateItems.AddRange(new object[] { compareControl1 });
// The validating operation will process in real time after every input action.
gcDateValidator1.SetSupportRealTimeValidating(gcDate1, true);
// The gcDate will use the DefaultValidateActions's settings
// as well as using the ValidateAction defined for itself.
gcDateValidator1.SetUseDefaultValidateActions(gcDate1, true);
// The gcDate will use the DefaultValidateItems's settings
// as well as using the ValidateItems defined for itself.
gcDateValidator1.SetUseDefaultValidateItems(gcDate1, true);
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcDateValidatorDefaultSettings()
' Creates an instance of a GcDate control.
Dim gcDate1 As New GcDate()
' Creates another instance of a GcDate control.
Dim gcDate2 As New GcDate()
' Creates an instance of a GcDateValidator component.
Dim gcDateValidator1 As New GcDateValidator()
' Creates a LineNotify item for notifying validation mode by displaying a red line.
Dim lineNotify1 As New LineNotify()
' Creates a CompareControl object.
Dim compareControl1 As New GcDateValidator.CompareControl()
' Adds a ValidateAction object to the DefaultValidateActions.
gcDateValidator1.DefaultValidateActions.AddRange(New ValidateAction() {lineNotify1})
' Sets the ComparedControl to the comparedGcDate, the value of target control should compare with the value of this.
compareControl1.ComparedControl = gcDate2
' Sets the ComparedOperator to the GreaterThanOrEquals. The value of target control should be greater than or equals
' with the value of the comparedGcDate.
compareControl1.ComparedOperator = ComparedOperator.GreaterThanOrEquals
' Adds the compareControl to the DefaultValidateItems.
gcDateValidator1.DefaultValidateItems.AddRange(New Object() {compareControl1})
' The validating operation will process in real time after every input action.
gcDateValidator1.SetSupportRealTimeValidating(gcDate1, True)
' The gcDate will use the DefaultValidateActions's settings
' as well as using the ValidateAction defined for itself.
gcDateValidator1.SetUseDefaultValidateActions(gcDate1, True)
' The gcDate will use the DefaultValidateItems's settings
' as well as using the ValidateItems defined for itself.
gcDateValidator1.SetUseDefaultValidateItems(gcDate1, True)
End Sub