method Surface.PositionToPoint (ByRef X as Long, ByRef Y as Long)
Converts element's position to display coordinates.

TypeDescription
X as Long (By Reference) A Long expression that determines the x-coordinate on the surface. On return it gets the x-coordinate on the screen.
Y as Long (By Reference) A Long expression that determines the y-coordinate on the surface. On return it gets the y-coordinate on the screen.
Use the PointToPosition / PositionToPoint property to convert screen coordinates to surface coordinates or reverse. The PointToPosition / PositionToPoint convert the giving point based on the ScrollX, ScrollY and Zoom conditions ( scroll position and the zooming factor of the surface ). The (0,0) point indicates the origin of the surface, so the X and Y parameters must be relative to the origin of the surface. The ElementFromPoint property gets the element from the surface giving the position on the surface. The ElementFromPoint(-1,-1) property returns the element from the cursor or nothing if no element at the current cursor position. On PowerBuilder, or any other environment that does not support parameters by reference you can use the ExecuteTemplate method. For instance, you can use a code like ExecuteTemplate("dim x,y;x=-1;y=-1;PointToPosition(x,y);x") that returns the x-position (surface's coordinates) of the current mouse pointer. In the same manner you can use ExecuteTemplate("dim x,y;x=-1;y=-1;PointToPosition(x,y);y") to return the y-position.