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