![]() | Type | Description | ||
| Button as Integer | An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. | |||
| Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys. | |||
| X as OLE_XPOS_PIXELS | A single that specifies the current X location of the mouse pointer. The x values is always expressed in container 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 container coordinates |
The following VB sample prints the editor from the point:
Private Sub Record1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim e As EXRECORDLibCtl.Editor
Set e = Record1.EditorFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY)
If Not e Is Nothing Then
Debug.Print e.Label & " = " & e.Value
End If
End Sub
The following VC sample prints the editor from the point:
static CString V2S( VARIANT* pv, LPCTSTR szDefault = _T("") )
{
if ( pv )
{
if ( pv->vt == VT_ERROR )
return szDefault;
COleVariant vt;
vt.ChangeType( VT_BSTR, pv );
return V_BSTR( &vt );
}
return szDefault;
}
void OnMouseMoveRecord1(short Button, short Shift, long X, long Y)
{
CEditor editor = m_record.GetEditorFromPoint( X, Y );
if ( editor.m_lpDispatch != NULL )
{
TCHAR szOutput[1024];
wsprintf( szOutput, "%s = %s\n", (LPCTSTR)editor.GetLabel(), (LPCTSTR)V2S( &editor.GetValue() ) );
OutputDebugString( szOutput );
}
}