// Please use the following namespace
// using System.Windows.Forms;
// using System.Drawing
// using GrapeCity.Win.Editors;
public void SetGcTimeValidatorDefaultSettings()
{
// Creates an instance of a GcTime control.
GcTime gcTime1 = new GcTime();
// Creates an instance of a GcTimeValidator component.
GcTimeValidator gcTimeValidator1 = new GcTimeValidator();
// Creates a instance of a ThreeStateBorderNotify object.
ThreeStateBorderNotify threeStateBorderNotify1 = new ThreeStateBorderNotify();
threeStateBorderNotify1.ValidLineColor = Color.Empty;
// Creates a CompareValue object.
GcTimeValidator.CompareValue compareValue1 = new GcTimeValidator.CompareValue();
compareValue1.ComparedOperator = ComparedOperator.SmallerThanOrEquals;
compareValue1.ComparedValue = System.TimeSpan.Parse("5.00:00:00");
// Adds a ValidateAction object to the DefaultValidateActions.
gcTimeValidator1.DefaultValidateActions.AddRange(new ValidateAction[] {threeStateBorderNotify1});
// Adds the compareValue to the DefaultValidateItems.
gcTimeValidator1.DefaultValidateItems.AddRange(new object[] {compareValue1});
// The gcTime will use the DefaultValidateActions's settings
// as well as using the ValidateAction defined for itself.
gcTimeValidator1.SetUseDefaultValidateActions(gcTime1, true);
// The gcTime will use the DefaultValidateItems's settings
// as well as using the ValidateItems defined for itself.
gcTimeValidator1.SetUseDefaultValidateItems(gcTime1, true);
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports System.Drawing
' Imports GrapeCity.Win.Editors;
Public Sub SetGcTimeValidatorDefaultSettings()
' Creates an instance of a GcTime control.
Dim gcTime1 As New GcTime()
' Creates an instance of a GcTimeValidator component.
Dim gcTimeValidator1 As New GcTimeValidator()
' Creates a instance of a ThreeStateBorderNotify object.
Dim threeStateBorderNotify1 As New ThreeStateBorderNotify()
threeStateBorderNotify1.ValidLineColor = Color.Empty
' Creates a CompareValue object.
Dim compareValue1 As New GcTimeValidator.CompareValue()
compareValue1.ComparedOperator = ComparedOperator.SmallerThanOrEquals
compareValue1.ComparedValue = System.TimeSpan.Parse("5.00:00:00")
' Adds a ValidateAction object to the DefaultValidateActions.
gcTimeValidator1.DefaultValidateActions.AddRange(New ValidateAction() {threeStateBorderNotify1})
' Adds the compareValue to the DefaultValidateItems.
gcTimeValidator1.DefaultValidateItems.AddRange(New Object() {compareValue1})
' The gcTime will use the DefaultValidateActions's settings
' as well as using the ValidateAction defined for itself.
gcTimeValidator1.SetUseDefaultValidateActions(gcTime1, True)
' The gcTime will use the DefaultValidateItems's settings
' as well as using the ValidateItems defined for itself.
gcTimeValidator1.SetUseDefaultValidateItems(gcTime1, True)
End Sub