ToolTipEventArgs 类


为在工具提示打开或关闭时发生的事件提供事件信息。Provides event information for events that occur when a tooltip opens or closes.

public ref class ToolTipEventArgs sealed : System::Windows::RoutedEventArgs
public sealed class ToolTipEventArgs : System.Windows.RoutedEventArgs
type ToolTipEventArgs = class
    inherit RoutedEventArgs
Public NotInheritable Class ToolTipEventArgs
Inherits RoutedEventArgs


当工具提示打开并关闭时,此类提供事件信息。When a tooltip opens and closes, this class provides event information. 指定工具提示的元素从 FrameworkElement 或继承 ContentElementThe element that specifies the tooltip inherits from either FrameworkElement or ContentElement. 因此,在这两个类上存在打开和关闭事件。Therefore, open and close events exist on both of these classes. 下表列出了使用此类的事件。The following table lists the events that use this class.

工具提示打开时发生的事件Events that occur when a tooltip opens 工具提示关闭时发生的事件Events that occur when a tooltip closes
FrameworkElement.ToolTipOpening FrameworkElement.ToolTipClosing
FrameworkContentElement.ToolTipOpening FrameworkContentElement.ToolTipClosing

这些事件由 ToolTipService 类注册为 ToolTipOpeningEventToolTipClosingEvent 字段。These events are registered by the ToolTipService class as the ToolTipOpeningEvent and ToolTipClosingEvent fields. FrameworkElementFrameworkContentElement 类都实现 ToolTipService 并通过定义上表中的事件来公开此事件The FrameworkElement and FrameworkContentElement classes both implement the ToolTipService and expose this event by defining the events in the previous table

ToolTipEventArgs类将重写 InvokeEventHandler 方法。The ToolTipEventArgs class overrides the InvokeEventHandler method. 但是,此受保护的成员不会出现在成员列表上, ToolTipEventArgs 因为该方法是密封的,不能在中的类中重写 ToolTipEventArgsHowever, this protected member does not appear on the ToolTipEventArgs list of members because the method is sealed and cannot be overridden in classes from ToolTipEventArgs. 此类中方法的实现将作为参数提供给方法的事件处理程序委托强制转换为 ToolTipEventHandler 类型。The implementation of the method in this class casts the event handler delegate that is provided as a parameter to the method to the ToolTipEventHandler type.

如果工具提示定义为 ToolTip 对象,则在 Opened Closed ToolTip 工具提示打开和关闭时也会引发类的和事件。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.



获取或设置一个值,该值指示针对路由事件(在其经过路由时)的事件处理的当前状态。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

(继承自 RoutedEventArgs)

在父类进行任何可能的 Source 调整之前,获取由纯命中测试确定的原始报告源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

(继承自 RoutedEventArgs)

获取或设置与此 RoutedEventArgs 实例关联的 RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance.

(继承自 RoutedEventArgs)

获取或设置对引发事件的对象的引用。Gets or sets a reference to the object that raised the event.

(继承自 RoutedEventArgs)



确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
InvokeEventHandler(Delegate, Object)

当在派生类中重写时,提供特定于类型的调用事件处理程序的方式,该方式与基实现相比可提高效率。When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.

(继承自 RoutedEventArgs)

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)

在派生类中重写时,每当实例的 Source 属性的值发生更改,则提供一个通知回调入口点。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.

(继承自 RoutedEventArgs)

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)