Automation.AddAutomationEventHandler メソッド

定義

UI オートメーション イベントを処理するメソッドを登録します。

public:
 static void AddAutomationEventHandler(System::Windows::Automation::AutomationEvent ^ eventId, System::Windows::Automation::AutomationElement ^ element, System::Windows::Automation::TreeScope scope, System::Windows::Automation::AutomationEventHandler ^ eventHandler);
public static void AddAutomationEventHandler (System.Windows.Automation.AutomationEvent eventId, System.Windows.Automation.AutomationElement element, System.Windows.Automation.TreeScope scope, System.Windows.Automation.AutomationEventHandler eventHandler);
static member AddAutomationEventHandler : System.Windows.Automation.AutomationEvent * System.Windows.Automation.AutomationElement * System.Windows.Automation.TreeScope * System.Windows.Automation.AutomationEventHandler -> unit
Public Shared Sub AddAutomationEventHandler (eventId As AutomationEvent, element As AutomationElement, scope As TreeScope, eventHandler As AutomationEventHandler)

パラメーター

eventId
AutomationEvent

メソッドが処理するイベントの識別子。

element
AutomationElement

イベント ハンドラーに関連付けるUI オートメーション要素。

scope
TreeScope

処理対象のイベントのスコープ (つまり、イベントが要素自体に関するものであるか、先祖および子孫に関するものであるか)。

eventHandler
AutomationEventHandler

指定したイベントが発生したときに呼び出すメソッド。

注釈

たとえば GridPattern、クラスに固有のイベントを識別するフィールドを公開するクラスもあります。 このメソッドは AddAutomationEventHandler 、これらのイベントのハンドラーを登録できるようにするメカニズムを提供します。

eventHandlerには、メソッドのインスタンス、またはメソッドへの参照 (AddressOfVisual Basic) を指定できます。

適用対象

こちらもご覧ください