Home > Code Library > SmartMenuXP > ClientToScreenX

Last Update 01 Nov 2001









SmartMenuXP Reference

ClientToScreenX Function

Converts an X-point expressed in client twips to a screen X-point expressed in pixels.


object.ClientToScreenX(hWnd, X)

The ClientToScreenX function syntax has these parts:

Part Description
object An object expression that evaluates to a SmartMenuXP object.
hWnd A numeric value that evaluates to a window handle.
X A numeric value that evaluates to a client X-point expressed in Twips.


This function is useful when it is used in conjunction with ClientToScreenY and PopupMenu.

Private Sub Form_MouseDown( _
    Button As Integer, _
    Shift As Integer, _
    X As Single, _
    Y As Single)

    If Button <> vbRightButton Then Exit Sub
        X = .ClientToScreenX(Me.hWnd, X)
        Y = .ClientToScreenY(Me.hWnd, Y)
        .PopupMenu .MenuItems.Key2ID("kMenu"), X, Y, 0
    End With
End Sub


Copyright © 2001, Andrés Pons (andres@vbsmart.com). All rights reserved.