PowerTools InputMan for Windows Forms 8.0J
DropDownOpeningEventArgs クラス
メンバ  使用例 

DropDownOpening イベントのイベントデータを格納します。
構文
Public Class DropDownOpeningEventArgs 
   Inherits System.ComponentModel.CancelEventArgs
public class DropDownOpeningEventArgs : System.ComponentModel.CancelEventArgs 
使用例
SyncData プロパティを利用する GcDateTime コントロールを作成するコード例を次に示します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void WireDropDownOpeningEvent()
{
    GcDateTime date1 = new GcDateTime();
    date1.DropDownOpening += new EventHandler<DropDownOpeningEventArgs>(OnDateDropDownOpening);
}

private void OnDateDropDownOpening(object sender, DropDownOpeningEventArgs e)
{            
    GcDateTime date1 = sender as GcDateTime;
    if (date1 != null)
    {
        if (date1.InputStatus != InputStatus.Empty &amp;&amp; date1.Value == null)
        {
            // Doesn't show the drop-down window when the value of the GcDateTime control is null.
            e.Cancel = true;
            // Doesn't synchronize data from drop-down window to the GcDateTime control.
            e.SyncData = false;
        }
    }
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub WireDropDownOpeningEvent()
    Dim GcDateTime1 As New GcDateTime()
    AddHandler GcDateTime1.DropDownOpening, AddressOf OnDateDropDownOpening
End Sub

Private Sub OnDateDropDownOpening(ByVal sender As Object, ByVal e As DropDownOpeningEventArgs)
    Dim GcDateTime1 As GcDateTime = TryCast(sender, GcDateTime)
    If (Not GcDateTime1 Is Nothing) Then
        If GcDateTime1.InputStatus <> InputStatus.Empty AndAlso GcDateTime1.Value = Nothing Then
            ' Doesn't show the drop-down window when the value of the GcDateTime control is Nothing.
            e.Cancel = True
            ' Doesn't synchronize data from drop-down window to the GcDateTime control.
            e.SyncData = False
        End If
    End If
End Sub
継承階層

System.Object
   System.EventArgs
      System.ComponentModel.CancelEventArgs
         GrapeCity.Win.Editors.DropDownOpeningEventArgs

参照

DropDownOpeningEventArgs メンバ
GrapeCity.Win.Editors 名前空間

 

 


© 2004-2015 GrapeCity inc. All rights reserved.