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. | |||
Date | A Date expression that indicates the date from the cursor. |
The following VB sample displays the date 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 Date d = .DateFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY) Debug.Print .FormatDate(d, "<%m%>/<%d%>/<%yyyy%>") End With End Sub
The following C++ sample displays the date from the point:
void OnMouseMoveGantt1(short Button, short Shift, long X, long Y) { CChart chart = m_gantt.GetChart(); DATE d = chart.GetDateFromPoint( X, Y ); CString strFormat = chart.GetFormatDate( d, "<%m%>/<%d%>/<%yyyy%>" ); OutputDebugString( strFormat ); }
The following VB.NET sample displays the date 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 Date d = .DateFromPoint(e.x, e.y) Debug.Write(.FormatDate(d, "<%m%>/<%d%>/<%yyyy%>")) End With End Sub
The following C# sample displays the date from the point:
private void axGantt1_MouseMoveEvent(object sender, AxEXGANTTLib._IGanttEvents_MouseMoveEvent e) { DateTime d = axGantt1.Chart.get_DateFromPoint(e.x, e.y); System.Diagnostics.Debug.Write(axGantt1.Chart.get_FormatDate(d, "<%m%>/<%d%>/<%yyyy%>")); }
The following VFP sample displays the date from the point:
*** ActiveX Control Event *** LPARAMETERS button, shift, x, y with thisform.Gantt1.Chart d = .DateFromPoint(x,y) wait window nowait .FormatDate(d, "<%m%>/<%d%>/<%yyyy%>" ) endwith