PowerTools InputMan for Windows Forms 8.0J
DefaultValidateItems プロパティ (GcDateValidator)
使用例 

既定検証項目のコレクションを取得します。
構文
Public Overrides Property DefaultValidateItems As Validator(Of GcDate)
public override Validator<GcDate> DefaultValidateItems {get; set;}

プロパティ値

既定検証項目。
使用例
次のサンプルコードは、検証項目と検証アクションを持つ GcDateValidator コンポーネントを作成します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void SetGcDateValidatorDefaultSettings()
{
    // Creates an instance of a GcDate control.
    GcDate gcDate1 = new GcDate();
    // Creates another instance of a GcDate control.
    GcDate gcDate2 = new GcDate();
    // Creates an instance of a GcDateValidator component.
    GcDateValidator gcDateValidator1 = new GcDateValidator();
    // Creates a LineNotify item for notifying validation mode by displaying a red line.
    LineNotify lineNotify1 = new LineNotify();
    // Creates a CompareControl object.
    GcDateValidator.CompareControl compareControl1 = new GcDateValidator.CompareControl();
    // Adds a ValidateAction object to the DefaultValidateActions.
    gcDateValidator1.DefaultValidateActions.AddRange(new ValidateAction[] { lineNotify1 });
    // Sets the ComparedControl to the comparedGcDate, the value of target control should compare with the value of this.
    compareControl1.ComparedControl = gcDate2;
    // Sets the ComparedOperator to the GreaterThanOrEquals. The value of target control should be greater than or equals
    // with the value of the comparedGcDate.
    compareControl1.ComparedOperator = ComparedOperator.GreaterThanOrEquals;
    // Adds the compareControl to the DefaultValidateItems.
    gcDateValidator1.DefaultValidateItems.AddRange(new object[] { compareControl1 });
    // The validating operation will process in real time after every input action.
    gcDateValidator1.SetSupportRealTimeValidating(gcDate1, true);
    // The gcDate will use the DefaultValidateActions's settings
    // as well as using the ValidateAction defined for itself.
    gcDateValidator1.SetUseDefaultValidateActions(gcDate1, true);
    // The gcDate will use the DefaultValidateItems's settings
    // as well as using the ValidateItems defined for itself.
    gcDateValidator1.SetUseDefaultValidateItems(gcDate1, true);
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub SetGcDateValidatorDefaultSettings()
    ' Creates an instance of a GcDate control.
    Dim gcDate1 As New GcDate()
    ' Creates another instance of a GcDate control.
    Dim gcDate2 As New GcDate()
    ' Creates an instance of a GcDateValidator component.
    Dim gcDateValidator1 As New GcDateValidator()
    ' Creates a LineNotify item for notifying validation mode by displaying a red line.
    Dim lineNotify1 As New LineNotify()
    ' Creates a CompareControl object.
    Dim compareControl1 As New GcDateValidator.CompareControl()
    ' Adds a ValidateAction object to the DefaultValidateActions.
    gcDateValidator1.DefaultValidateActions.AddRange(New ValidateAction() {lineNotify1})
    ' Sets the ComparedControl to the comparedGcDate, the value of target control should compare with the value of this.
    compareControl1.ComparedControl = gcDate2
    ' Sets the ComparedOperator to the GreaterThanOrEquals. The value of target control should be greater than or equals
    ' with the value of the comparedGcDate.
    compareControl1.ComparedOperator = ComparedOperator.GreaterThanOrEquals
    ' Adds the compareControl to the DefaultValidateItems.
    gcDateValidator1.DefaultValidateItems.AddRange(New Object() {compareControl1})
    ' The validating operation will process in real time after every input action.
    gcDateValidator1.SetSupportRealTimeValidating(gcDate1, True)
    ' The gcDate will use the DefaultValidateActions's settings
    ' as well as using the ValidateAction defined for itself.
    gcDateValidator1.SetUseDefaultValidateActions(gcDate1, True)
    ' The gcDate will use the DefaultValidateItems's settings
    ' as well as using the ValidateItems defined for itself.
    gcDateValidator1.SetUseDefaultValidateItems(gcDate1, True)
End Sub
参照

GcDateValidator クラス
GcDateValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.