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