event DblClick (Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user dblclk the left mouse button over an object.

 TypeDescription 
   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 DblClick event notifies your application that user double clicked the control's client area. Use the DateFromPoint property to retrieve the date from cursor.

The following sample prints the date from the cursor:

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

Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.