ToolTipEventHandler 代理人

定義

表示將處理工具提示開啟和關閉時所發生之路由事件的方法。Represents the method that will handle routed event that occur when a tooltip opens and closes.

public delegate void ToolTipEventHandler(System::Object ^ sender, ToolTipEventArgs ^ e);
public delegate void ToolTipEventHandler(object sender, ToolTipEventArgs e);
type ToolTipEventHandler = delegate of obj * ToolTipEventArgs -> unit
Public Delegate Sub ToolTipEventHandler(sender As Object, e As ToolTipEventArgs)

參數

sender
Object

附加事件處理常式的物件。The object where the event handler is attached.

e
ToolTipEventArgs

事件資料。The event data.

繼承
ToolTipEventHandler

備註

當工具提示開啟和關閉時, 這個委派會提供事件處理常式。When a tooltip opens and closes, this delegate provides an event handler. 指定工具提示的元素會繼承自FrameworkElement或。 FrameworkContentElementThe element that specifies the tooltip inherits from either FrameworkElement or FrameworkContentElement. 因此, 這兩個類別都有開啟和關閉的事件。Therefore, open and close events exist on both of these classes. 下表列出使用此事件處理常式的事件。The following table lists the events that use this event handler.

工具提示開啟時所發生的事件Events that occur when a tooltip opens 工具提示關閉時所發生的事件Events that occur when a tooltip closes
FrameworkElement.ToolTipOpening FrameworkElement.ToolTipClosing
FrameworkContentElement.ToolTipOpening FrameworkContentElement.ToolTipClosing

這些事件是ToolTipService由類別ToolTipOpeningEvent使用ToolTipClosingEvent和欄位所註冊, 但類別不會自行公開這些事件(附加或其他)。ToolTipServiceThese events are registered by the ToolTipService class using the ToolTipOpeningEvent and ToolTipClosingEvent fields, but the ToolTipService class does not expose these events on itself (attached or otherwise). ToolTipService FrameworkElement和類別都會執行ToolTipService , 並藉由定義上表中的事件來公開這個事件, 複製欄位以建立存在於和的新路由事件識別碼。 FrameworkContentElement FrameworkElementFrameworkContentElement類別。The FrameworkElement and FrameworkContentElement classes both implement the ToolTipService and expose this event by defining the events in the previous table, copying the ToolTipService fields to create new routed event identifiers that exist on the FrameworkElement and FrameworkContentElement classes.

如果工具ToolTip提示是定義為物件, 則當工具提示開啟和關閉時, 也會引發ToolTip類別的OpenedClosed事件。If the tooltip is defined as a ToolTip object, the Opened and Closed events of the ToolTip class are also raised when a tooltip opens and closes.

擴充方法

GetMethodInfo(Delegate)

取得表示特定委派所代表之方法的物件。Gets an object that represents the method represented by the specified delegate.

適用於

另請參閱