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

ActionExecutingイベントのデータを提供します。
構文
Public Class ActionExecutingEventArgs 
   Inherits System.EventArgs
public class ActionExecutingEventArgs : System.EventArgs 
使用例
次のコードは ActionExecuting イベントを発生させる方法を示します。この例では、 ActionExecuting イベントと連携するイベント処理を呼び出します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void WireActionExecutingEvent()
{
    // Creates an instace of the GcTextBox control.
    GcTextBox gcTextBox1 = new GcTextBox();
    // Creates an instace of the GcShortcut component.
    GcShortcut gcShortcut1 = new GcShortcut();
    // Sets the Alt + C to execute the clear behavior.
    gcShortcut1.SetShortcuts(gcTextBox1, new ShortcutCollection(new Keys[] { Keys.Alt | Keys.C }, new object[] { gcTextBox1 }, new string[] { "ShortcutClear" }));
    gcShortcut1.ActionExecuting += new EventHandler<ActionExecutingEventArgs>(OnShortcutActionExecuting);
}

private void OnShortcutActionExecuting(object sender, ActionExecutingEventArgs e)
{
    if (e.Target is GcTextBox &amp;&amp; (e.Target as GcTextBox).DroppedDown &amp;&amp; e.ShortcutKey == (Keys.Alt | Keys.C) &amp;&amp; e.ActionName == "ShortcutClear")
    {                 
        // When the drop down window opened, executes the clear action.
        e.CanExecute = true;
    }
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub WireActionExecutingEvent()
    ' Creates an instace of the GcTextBox control.
    Dim gcTextBox1 As New GcTextBox()
    ' Creates an instace of the GcShortcut component.
    Dim gcShortcut1 As New GcShortcut()
    ' Sets the Alt + C to execute the clear behavior.
    gcShortcut1.SetShortcuts(gcTextBox1, New ShortcutCollection(New Keys() {Keys.Alt Or Keys.C}, New Object() {gcTextBox1}, New String() {"ShortcutClear"}))
    AddHandler gcShortcut1.ActionExecuting, AddressOf OnShortcutActionExecuting
End Sub

Private Sub OnShortcutActionExecuting(ByVal sender As Object, ByVal e As ActionExecutingEventArgs)
    If TypeOf e.Target Is GcTextBox AndAlso TryCast(e.Target, GcTextBox).DroppedDown AndAlso e.ShortcutKey = (Keys.Alt Or Keys.C) AndAlso e.ActionName = "ShortcutClear" Then
        ' When the drop down window opened, executes the clear action.
        e.CanExecute = True
    End If
End Sub
継承階層

System.Object
   System.EventArgs
      GrapeCity.Win.Editors.ActionExecutingEventArgs

参照

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

 

 


© 2004-2015 GrapeCity inc. All rights reserved.