PowerTools MultiRow for Windows Forms 8.0J
SyncData プロパティ (DropDownClosingEventArgs)
使用例 

ドロップダウンが閉じられたとき、データを同期するか、しないかを取得または設定します。
構文
Public Property SyncData As Boolean
public bool SyncData {get; set;}

プロパティ値

説明
True データを同期します。
False データを同期しません。
解説
このプロパティは、ドロップダウンが閉じるときにドロップダウンのデータをコントロールに同期するかどうかを決定します。
使用例
SyncData プロパティを利用する GcDateTime コントロールを作成するコード例を次に示します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void WireDropDownClosingEvent()
{
    GcDateTime date1 = new GcDateTime();
    date1.DropDownClosing += new EventHandler<DropDownClosingEventArgs>(OnDateDropDownClosing);
}

private void OnDateDropDownClosing(object sender, DropDownClosingEventArgs e)
{
    if ((e.Value is DateTime) && (DateTime)e.Value < DateTime.Now)
    {
        // If the value of drop-down calendar is less than DateTime.Now, 
        // it's not synchornized.
        e.SyncData = false;
    }
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub WireDropDownClosingEvent()
    Dim GcDateTime1 As New GcDateTime()
    AddHandler GcDateTime1.DropDownClosing, AddressOf OnDateDropDownClosing
End Sub

Private Sub OnDateDropDownClosing(ByVal sender As Object, ByVal e As DropDownClosingEventArgs)
    If (TypeOf e.Value Is DateTime) AndAlso DirectCast(e.Value, DateTime) < DateTime.Now Then
        ' If the value of drop-down calendar is less than DateTime.Now, 
        ' it's not synchornized.
        e.SyncData = False
    End If
End Sub
参照

DropDownClosingEventArgs クラス
DropDownClosingEventArgs メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.