// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void SetGcNumberValidatorSettings()
{
// Creates an instance of a GcNumber control.
GcNumber gcNumber1 = new GcNumber();
// Creates an instance of a GcNumberValidator component.
GcNumberValidator gcNumberValidator1 = new GcNumberValidator();
// Creates an InvalidRange object and sets the properties.
GcNumberValidator.InvalidRange invalidRange1 = new GcNumberValidator.InvalidRange();
invalidRange1.MaxValue = 0m;
invalidRange1.MinValue = 0m;
invalidRange1.NullIsValid = false;
// Creates a ThreeStateIconNotify object.
ThreeStateIconNotify threeStateIconNotify1 = new ThreeStateIconNotify();
// Gets the ValidateActions defined for the gcNumber1, and adds the ThreeStateIconNotify object to the collection.
gcNumberValidator1.GetValidateActions(gcNumber1).AddRange(new ValidateAction[] {threeStateIconNotify1});
// Gets the ValidateItems defined for the gcNumber1, and adds the InvalidRange object to the collection.
gcNumberValidator1.GetValidateItems(gcNumber1).AddRange(new object[] {invalidRange1});
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcNumberValidatorSettings()
' Creates an instance of a GcNumber control.
Dim gcNumber1 As New GcNumber()
' Creates an instance of a GcNumberValidator component.
Dim gcNumberValidator1 As New GcNumberValidator()
' Creates an InvalidRange object and sets the properties.
Dim invalidRange1 As New GcNumberValidator.InvalidRange()
invalidRange1.MaxValue = 0D
invalidRange1.MinValue = 0D
invalidRange1.NullIsValid = False
' Creates a ThreeStateIconNotify object.
Dim threeStateIconNotify1 As New ThreeStateIconNotify()
' Gets the ValidateActions defined for the gcNumber1, and adds the ThreeStateIconNotify object to the collection.
gcNumberValidator1.GetValidateActions(gcNumber1).AddRange(New ValidateAction() {threeStateIconNotify1})
' Gets the ValidateItems defined for the gcNumber1, and adds the InvalidRange object to the collection.
gcNumberValidator1.GetValidateItems(gcNumber1).AddRange(New Object() {invalidRange1})
End Sub