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

コントロールを表すControlオブジェクト。
コントロールに関連付けられた検証アイテムのコレクションを取得します。
構文
Public Overrides Function GetValidateItems( _
   ByVal control As Control _
) As Validator(Of GcNumber)
public override Validator<GcNumber> GetValidateItems( 
   Control control
)

パラメータ

control
コントロールを表すControlオブジェクト。
使用例
検証アイテムと検証アクションを設定した GcNumberValidator コンポーネントを作成するコード例を次に示します。
//  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
参照

GcNumberValidator クラス
GcNumberValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.