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

既定の検証アイテムのコレクションを取得または設定します。
構文
Public Overrides Property DefaultValidateItems As Validator(Of Control)
public override Validator<Control> DefaultValidateItems {get; set;}

プロパティ値

検証アイテムのコレクションを表す Validator<Control>. ValidateItemCollectionオブジェクト。
使用例
検証アイテムと検証アクションを設定した GcCommonValidator コンポーネントを作成するコード例を次に示します。この例では他に DefaultValidateItems プロパティ、 Validator<T>.SetUseDefaultValidateItemsValidator<T>.SetUseDefaultValidateActions メソッドを使用しています。
//  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
参照

GcCommonValidator クラス
GcCommonValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.