MouseDown Event

Description

This event fires when the mouse pointer is over the DynamiCube object and a mouse button is pressed.

Syntax

Public Event MouseDown( _
   ByVal Button As Integer, _
   ByVal Shift As Integer, _
   ByVal X As Long, _
   ByVal Y As Long _
)

Parameters

Button
Specifies which mouse button was pressed.
Shift
Specifies the state of the SHIFT key.
X
Specifies the X coordinate in pixels of a mouse click.
Y
Specifies the Y coordinate in pixels of a mouse click.

Example

[MouseDown event (Visual Basic)] 

Private Sub DCube1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim HitRec As Object
    On Error Resume Next
    Set HitRec = DCube1.CalcHit
    If Button = vbRightButton Then
       'First select the cell under the mouse
       If HitRec.Area = 1 Then
          DCube1.SelStartCol = HitRec.Column
          DCube1.SelEndCol = HitRec.Column
          DCube1.SelStartRow = HitRec.Row
          DCube1.SelEndRow = HitRec.Row
          DCube1.Refresh
        End If
    End If
    On Error GoTo 0
End Sub

See Also

DCube Control

 

 


Copyright © 2007 Data Dynamics, Ltd. All rights reserved.