Share via


clientX Property

Returns an Integer that represents the horizontal position of the mouse pointer relative to the client area of the window, excluding window decorations and scroll bars.

expression.clientX

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

Since the clientX property returns a value relative to the client, you can add the value of the scrollLeft property to determine the distance from the left edge of the BODY element.

Example

The following example displays a message that contains the horizontal and vertical position of the mouse pointer every time a user resizes the Microsoft FrontPage application window. This example must be placed in a class module, and it assumes you have declared an FPHTMLWindow2 object variable called "window."

Private Sub window_onresize()
    Dim wEvent As IHTMLEventObj

    Set wEvent = window.event
       
    MsgBox "Your mouse is located at:" & vbCrLf & _
        "Left: " & wEvent.clientX & vbCrLf & _
        "Top:  " & wEvent.clientY & vbCrLf & _
        "Are you having fun?", vbYesNo
    
End Sub

Applies to | IHTMLEventObj Object