![]() | Type | Description | ||
| Button as Integer | An integer that identifies the button that was pressed to cause the event. | |||
| Shift as Integer | An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the button argument is pressed or released. | |||
| 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 displays a message when user right clicks the control:
Private Sub Record1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button = vbRightButton) Then
Dim e As EXRECORDLibCtl.Editor
Set e = Record1.EditorFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY)
If Not e Is Nothing Then
MsgBox e.Label
End If
End If
End Sub
The following VC sample displays a message when user right clicks the control:
void OnMouseUpRecord1(short Button, short Shift, long X, long Y)
{
if ( Button == 2 )
{
CEditor editor = m_record.GetEditorFromPoint( X, Y );
if ( editor.m_lpDispatch != NULL )
{
TCHAR szOutput[1024];
wsprintf( szOutput, "%s", (LPCTSTR)editor.GetLabel() );
::MessageBox( NULL, szOutput, NULL, NULL );
}
}
}