Export (0) Print
Expand All

ToolTipEventArgs Class

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

System.Object
  System.EventArgs
    System.Windows.Forms.DataVisualization.Charting.ToolTipEventArgs

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.

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

  NameDescription
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.
Top

  NameDescription
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 the default hash function. (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.)
Top

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.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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.
Show:
© 2014 Microsoft