

| Type | Description | |||
| X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in client coordinates. | |||
| Y as OLE_YPOS_PIXELS | A single that specifies the current Y location of the mouse pointer. The y values is always expressed in client coordinates. | |||
| Long | A long expression that indicates the index of the level from the point, or -1 if the cursor is not in the chart's header. |
The following VB sample displays the label of the level from the cursor:
Private Sub Gantt1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Gantt1.Chart
Dim d As Long
d = .LevelFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY)
If d >= 0 Then
Debug.Print .Level(d).Label
End If
End With
End Sub
The following C++ sample displays the label of the level from the point:
void OnMouseMoveGantt1(short Button, short Shift, long X, long Y)
{
CChart chart = m_gantt.GetChart();
long d = chart.GetLevelFromPoint( X, Y );
if ( d >= 0 )
OutputDebugString( V2S( &chart.GetLevel(d).GetLabel() ) );
}
The following VB.NET sample displays the label of the level from the point:
Private Sub AxGantt1_MouseMoveEvent(ByVal sender As Object, ByVal e As AxEXGANTTLib._IGanttEvents_MouseMoveEvent) Handles AxGantt1.MouseMoveEvent
With AxGantt1.Chart
Dim d As Integer = .LevelFromPoint(e.x, e.y)
If (d >= 0) Then
Debug.Write(.Level(d).Label)
End If
End With
End Sub
The following C# sample displays the label of the level from the point:
private void axGantt1_MouseMoveEvent(object sender, AxEXGANTTLib._IGanttEvents_MouseMoveEvent e)
{
int d = axGantt1.Chart.get_LevelFromPoint(e.x, e.y);
if ( d >=0 )
System.Diagnostics.Debug.Write(axGantt1.Chart.get_Level(d).Label );
}
The following VFP sample displays the label of the level from the point:
*** ActiveX Control Event *** *** ActiveX Control Event *** LPARAMETERS button, shift, x, y with thisform.Gantt1.Chart d = .LevelFromPoint(x,y) if ( d>=0 ) wait window nowait .Level(d).Label endif endwith