PowerTools InputMan for Windows Forms 8.0J
GetValidateItems メソッド (GcDateValidator)
使用例 

検証するターゲット。
ValidateItem を含むコレクションを取得します。
構文
Public Overrides Function GetValidateItems( _
   ByVal control As Control _
) As Validator(Of GcDate)
public override Validator<GcDate> GetValidateItems( 
   Control control
)

パラメータ

control
検証するターゲット。
使用例
次のサンプルコードは、検証項目と検証アクションを持つ GcDateValidator コンポーネントを作成します。
//  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
参照

GcDateValidator クラス
GcDateValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.