event MouseUp (Button as Integer, Shift as Integer, X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS)
Occurs when the user releases a mouse button.

 TypeDescription 
   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.  

Use a MouseDown or MouseUp event procedure to specify actions that will occur when a mouse button is pressed or released. Unlike the Click and DblClick events, MouseDown and MouseUp events lets you distinguish between the left, right, and middle mouse buttons. You can also write code for mouse-keyboard combinations that use the SHIFT, CTRL, and ALT keyboard modifiers. Use the Activate event if your application needs to be notified when a new page is activated. Use the PageFromPoint property to get the page from the cursor.

The following sample prints the page from the cursor:

Private Sub Tab1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    With Tab1
        Dim p As Long
        p = .PageFromPoint(X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY)
        If (p >= 0) Then
            Debug.Print "The page " & .Pages(.Pages.PosToIndex(p)).Caption
        End If
    End With
End Sub

 


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