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

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

パラメータ

control
コントロールを表すControlオブジェクト。

戻り値の型

使用例
検証アイテムと検証アクションを設定した GcDateTimeValidator コンポーネントを作成するコード例を次に示します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void SetGcDateTimeValidatorSettings()
{
    // Creates an instance of a GcDateTime control.
    GcDateTime GcDateTime1 = new GcDateTime();
    // Creates an instance of a GcDateTimeValidator component.
    GcDateTimeValidator GcDateTimeValidator1 = new GcDateTimeValidator();
    // Creates a InvalidRange object.
    GcDateTimeValidator.InvalidRange invalidRange1 = new GcDateTimeValidator.InvalidRange();
    invalidRange1.MaxValue = new System.DateTime(2009, 12, 31, 23, 59, 59, 0);
    invalidRange1.MinValue = new System.DateTime(2009, 1, 1, 0, 0, 0, 0);
    // Creates a SoundNotify object.
    SoundNotify soundNotify1 = new SoundNotify();
    // Gets the ValidateActions defined for the GcDateTime, and adds the ThreeStateIconNotify object to the collection.
    GcDateTimeValidator1.GetValidateActions(GcDateTime1).AddRange(new ValidateAction[] { soundNotify1 });
    // Gets the ValidateItems defined for the GcDateTime, and adds the InvalidRange object to the collection.
    GcDateTimeValidator1.GetValidateItems(GcDateTime1).AddRange(new object[] { invalidRange1 });
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub SetGcDateTimeValidatorSettings()
    ' Creates an instance of a GcDateTime control.
    Dim GcDateTime1 As New GcDateTime()
    ' Creates an instance of a GcDateTimeValidator component.
    Dim GcDateTimeValidator1 As New GcDateTimeValidator()
    ' Creates a InvalidRange object.
    Dim invalidRange1 As New GcDateTimeValidator.InvalidRange()
    invalidRange1.MaxValue = New System.DateTime(2009, 12, 31, 23, 59, 59, _
     0)
    invalidRange1.MinValue = New System.DateTime(2009, 1, 1, 0, 0, 0, _
     0)
    ' Creates a SoundNotify object.
    Dim soundNotify1 As New SoundNotify()
    ' Gets the ValidateActions defined for the GcDateTime, and adds the ThreeStateIconNotify object to the collection.
    GcDateTimeValidator1.GetValidateActions(GcDateTime1).AddRange(New ValidateAction() {soundNotify1})
    ' Gets the ValidateItems defined for the GcDateTime, and adds the InvalidRange object to the collection.
    GcDateTimeValidator1.GetValidateItems(GcDateTime1).AddRange(New Object() {invalidRange1})
End Sub
参照

GcDateTimeValidator クラス
GcDateTimeValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.