Dundas Chart for Windows Forms
HitTestResult Property
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > ToolTipEventArgs Class : HitTestResult Property


Gets a HitTestResult object, which provides information about the chart element the GetToolTipText event was raised for.
Hit Test Result Object.

Syntax

Visual Basic (Declaration)  
Public ReadOnly Property HitTestResult As HitTestResult
Visual Basic (Usage) Copy Code
Dim instance As ToolTipEventArgs
Dim value As HitTestResult
 
value = instance.HitTestResult
C#  
public HitTestResult HitTestResult {get;}

Return Value

An object of type HitTestResult that represents information for the element the GetToolTipText event was raised for.

Example

We use this event to provide tooltip text for a scrollbar thumb, which is associated with the primary X axis in a chart area named "Default".
C# Copy Code
using Dundas.Charting.WinControl;
...
// NOTE: Add events In C# using the Properties window so that the Event handler code Is added correctly
Private void chart1_GetToolTipText(Object sender, Dundas.Charting.WinControl.ToolTipEventArgs e)
{
   
// Check For scrolling thumb
   
If(e.HitTestResult.ChartElementType == ChartElementType.SBThumbTracker)
   {
       
// Check For chart area Object
       
If(e.HitTestResult.ChartArea.Name == "Default")
       {
           
// Check For axis Type
           
If(e.HitTestResult.Axis.Type == AxisName.X)
           {
               
// We have the right scrolling thumb, Set tooltip text
               
e.Text = "Scrolling thumb text";
           }
       }
   }
}
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...
Private Sub chart1_GetToolTipText(ByVal sender As Object, ByVal e As Dundas.Charting.WinControl.ToolTipEventArgs) _ Handles chart1.GetToolTipText

    ' Check for scrolling thumb
    If e.HitTestResult.ChartElementType = ChartElementType.SBThumbTracker Then

        ' Check for chart area object
        If e.HitTestResult.ChartArea.Name = "Default" Then

            ' Check for axis type
            If e.HitTestResult.Axis.Type = AxisName.X Then

                ' We have the right scrolling thumb, set tooltip text
                e.Text = "Scrolling thumb text"

            End If
        End If
    End If
End Sub

Remarks

This property is exposed in the GetToolTipText event of the root Chart object.

HitTestResult can be used to get the object the event was raised for, the type of the chart element the event was raised for, etc.  For further details see the HitTestResult class overview.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.