event MouseMove (Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user moves the mouse.

 TypeDescription 
   Button as Integer Gets which mouse button was pressed as 1 for Left Mouse Button, 2 for Right Mouse Button and 4 for Middle Mouse Button.  
   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  

he MouseMove event is generated continually as the mouse pointer moves across objects. Unless another object has captured the mouse, an object recognizes a MouseMove event whenever the mouse position is within its borders. Use the DateFromPoint property to retrieve the date from the cursor.

Use the following sample to retrieves the date over the cursor:

Private Sub Calendar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim d As Date
    d = Calendar1.DateFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY)
    If d <> 0 Then
        Debug.Print FormatDateTime(d)
    End If
End Sub
 

Send comments on this topic.
© 1999-2012 Exontrol.COM, Software. All rights reserved.