// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void SetGcDateValidatorSettings()
{
// Creates an instance of a GcDate control.
GcDate gcDate1 = new GcDate();
// Creates an instance of a GcDateValidator component.
GcDateValidator gcDateValidator1 = new GcDateValidator();
// Creates a InvalidRange object.
GcDateValidator.InvalidRange invalidRange1 = new GcDateValidator.InvalidRange();
invalidRange1.MaxValue = new System.DateTime(2009, 12, 31);
invalidRange1.MinValue = new System.DateTime(2009, 1, 1);
// Creates a SoundNotify object.
SoundNotify soundNotify1 = new SoundNotify();
// Gets the ValidateActions defined for the gcDate, and adds the ThreeStateIconNotify object to the collection.
gcDateValidator1.GetValidateActions(gcDate1).AddRange(new ValidateAction[] { soundNotify1 });
// Gets the ValidateItems defined for the gcDate, and adds the InvalidRange object to the collection.
gcDateValidator1.GetValidateItems(gcDate1).AddRange(new object[] { invalidRange1 });
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcDateValidatorSettings()
' Creates an instance of a GcDate control.
Dim gcDate1 As New GcDate()
' Creates an instance of a GcDateValidator component.
Dim gcDateValidator1 As New GcDateValidator()
' Creates a InvalidRange object.
Dim invalidRange1 As New GcDateValidator.InvalidRange()
invalidRange1.MaxValue = New System.DateTime(2009, 12, 31)
invalidRange1.MinValue = New System.DateTime(2009, 1, 1)
' Creates a SoundNotify object.
Dim soundNotify1 As New SoundNotify()
' Gets the ValidateActions defined for the gcDate, and adds the ThreeStateIconNotify object to the collection.
gcDateValidator1.GetValidateActions(gcDate1).AddRange(New ValidateAction() {soundNotify1})
' Gets the ValidateItems defined for the gcDate, and adds the InvalidRange object to the collection.
gcDateValidator1.GetValidateItems(gcDate1).AddRange(New Object() {invalidRange1})
End Sub