property Surface.ElementFromPosition (X as Long, Y as Long) as Element
Gets the Element object from the position.

TypeDescription
X as Long A Long expression that specifies the x-coordinate on the surface.
Y as Long A Long expression that specifies the y-coordinate on the surface.
Element An Element object from the position.
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. Use the PointToPosition / PositionToPoint property to convert screen coordinates to surface coordinates or reverse. The ElementFromPoint(-1,-1) property returns the element from the cursor or nothing if no element at the current cursor position. The X and Y properties specifies the position of the element on the surface. The Width property specifies the width of the element, in surface coordinates. The Height property specifies the height of the element, in surface coordinates.