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. 指定工具提示的元素从FrameworkElementFrameworkContentElement继承。The 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.

适用于

另请参阅