ToolTipEventArgs Class
Collapse the table of content
Expand the table of content

ToolTipEventArgs Class

Used as a parameter object in the GetToolTipText event of the root Chart object.


Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

public class ToolTipEventArgs : EventArgs

The ToolTipEventArgs type exposes the following members.

Public methodToolTipEventArgsInitializes a new instance of the ToolTipEventArgs class with the specified x, y, text and result parameters.

Public propertyHitTestResultGets a HitTestResult object, which provides information about the chart element that the GetToolTipText event was raised for.
Public propertyTextGets or sets the tooltip, if any, of the chart element over which the mouse cursor is held. This property can also set a tooltip for this chart element.
Public propertyXGets the X coordinate of the point the mouse cursor is held over when the GetToolTipText event is raised.
Public propertyYGets the Y coordinate of the point the mouse cursor is held over when the GetToolTipText event is raised.

Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

This class is exposed as the e parameter in the GetToolTipText event, and provides the mouse position, tooltip text, if any, and details about the chart element over which the mouse cursor is held when the event is raised.

The GetToolTipText event is raised several seconds after the mouse cursor is held over a relevant chart element.

The ToolTipEventArgs class contains the following properties:

  • The X and Y properties, which are used to get the mouse coordinates.

  • The Text property, which is used to get the tooltip for the chart element that the event is raised for. Note that many of the chart elements have a ToolTip, LegendToolTip, and/or [LabelToolTip] property that you can use to assign a tooltip. These elements include legends, annotations, data points, series, axes, titles, custom labels, and strip lines. This property can also be used to override the tooltip for a chart element, or to set a tooltip for a chart element that doesn't have a ToolTip property.

  • The HitTestResult property, which provides information on the chart element for which the event was raised.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2016 Microsoft