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