MouseX Property (Desktop Objects)

Applies to TestComplete 15.44, last modified on November 10, 2022

Description

Use this property to set or get the current screen-relative horizontal coordinate of the mouse cursor.

Declaration

TestObj.MouseX

Read-Write Property Integer
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following object:

View Mode

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Property Value

An integer value holding the current horizontal coordinate of the mouse pointer in pixels.

Remarks

You can use the ScreenToWindow method of the Onscreen object to convert screen-relative coordinates to client area-relative coordinates.

Example

The following examples demonstrate how to use the property to move the mouse cursor:

JavaScript, JScript

Sys.Desktop.MouseX += 50;

Python

Sys.Desktop.MouseX += 50

VBScript

Set d = Sys.Desktop
d.MouseX = d.MouseX + 50

DelphiScript

d := Sys.Desktop;
d.MouseX := d.MouseX + 50;

C++Script, C#Script

Sys["Desktop"]["MouseX"] += 50;

See Also

MouseY Property (Desktop Objects)

Highlight search results