// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void SetGcCommonValidatorDefaultSettings()
{
// Creates an instance of a TextBox control.
TextBox textBox1 = new TextBox();
// Creates an instance of a GcCommonValidator component.
GcCommonValidator gcCommonValidator1 = new GcCommonValidator();
// Creates an IconNotify object.
IconNotify iconNotify1 = new IconNotify();
// Creates an EmptyText object.
EmptyText emptyText1 = new EmptyText();
// Adds a ValidateAction object to the DefaultValidateActions.
gcCommonValidator1.DefaultValidateActions.AddRange(new ValidateAction[] { iconNotify1 });
// Adds the emptyText to the DefaultValidateItems.
gcCommonValidator1.DefaultValidateItems.AddRange(new object[] { emptyText1 });
// The textBox will use the DefaultValidateActions's settings
// as well as using the ValidateAction defined for itself.
gcCommonValidator1.SetUseDefaultValidateActions(textBox1, true);
// The textBox will use the DefaultValidateItems's settings
// as well as using the ValidateItems defined for itself.
gcCommonValidator1.SetUseDefaultValidateItems(textBox1, true);
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub SetGcCommonValidatorDefaultSettings()
' Creates an instance of a TextBox control.
Dim textBox1 As New TextBox()
' Creates an instance of a GcCommonValidator component.
Dim gcCommonValidator1 As New GcCommonValidator()
' Creates an IconNotify object.
Dim iconNotify1 As New IconNotify()
' Creates an EmptyText object.
Dim emptyText1 As New EmptyText()
' Adds a ValidateAction object to the DefaultValidateActions.
gcCommonValidator1.DefaultValidateActions.AddRange(New ValidateAction() {iconNotify1})
' Adds the emptyText to the DefaultValidateItems.
gcCommonValidator1.DefaultValidateItems.AddRange(New Object() {emptyText1})
' The textBox will use the DefaultValidateActions's settings
' as well as using the ValidateAction defined for itself.
gcCommonValidator1.SetUseDefaultValidateActions(textBox1, True)
' The textBox will use the DefaultValidateItems's settings
' as well as using the ValidateItems defined for itself.
gcCommonValidator1.SetUseDefaultValidateItems(textBox1, True)
End Sub