Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Limits in browser code
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Used in an linked event with the mouse or the stylus (click code, hover code, left or right button pressed code, ...) returns the horizontal (X) position of the mouse cursor in relation to the control or the window considered.
You can find out:
  • the position of the mouse (or stylus) when left-clicking in an Image control (function used in the "Click" event of the Image control).
  • the position of the mouse (or stylus) when hovering over a window (function used in the optional "Mouse hover" event of a window).
WEBDEV - Browser code Used in a browser event (of an control or a page), returns the horizontal position (X) of the mouse cursor according to the specified marker.
    WEBDEV - Browser code
    // Survol souris de la page "Dessin"
    // Code optionnel de la page
    // Souris déplacée (onmousemove)
    Message("Position de la souris: X: " + MouseXPos(mpPage) + " Y: " + MouseYPos(mpPage))
    WEBDEV - Browser code

    Retrieving the mouse position in a page Hide the details

    <Result> = MouseXPos([<Marker>])
    <Result>: Integer or real
    • Horizontal position (or X coordinate) of the mouse cursor in relation to the specified marker (in pixels),
    • 0 if the information is not available (depending on the browser used and on the control).
    <Marker>: Optional integer constant
    Marker used to calculate the position:
    (Default value)
    Mouse position relative to the top left point of the hovered control (or of the page if no control is hovered and if the event is on the page).
    If this constant is selected, MouseXPos must be used in the "OnClick" code of control.
    mpScreenMouse position in the screen (in relation to the top left corner of screen).
    mpPageMouse position in relation to the top left corner of page (while taking the page "scrolling" into account).
    WEBDEV - Browser code

    Limits in browser code

    MouseXPos is not available:
    • in browser procedures.
    • in the events directly or indirectly called from a browser procedure (via ExecuteProcess for example).
    • in the browser code of a Button or Link control..
    Related Examples:
    The drawing functions Unit examples (WINDEV): The drawing functions
    [ + ] Using the main drawing functions of WINDEV to:
    - Initialize an Image control for drawing
    - Draw simple shapes
    - Write a text into a drawing
    - Change the color in a drawing
    Component: wd270obj.dll
    Minimum version required
    • Version 9
    This page is also available for…
    Click [Add] to post a comment