HtmlDocument::GetElementFromPoint Method (Point)
.NET Framework (current version)
Retrieves the HTML element located at the specified client coordinates.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- point
-
Type:
System.Drawing::Point
The x,y position of the element on the screen, relative to the top-left corner of the document.
Return Value
Type: System.Windows.Forms::HtmlElement^The HtmlElement at the specified screen location in the document.
GetElementFromPoint uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the Position property.
The following code example detects a click on the document, finds the element, and uses ScrollIntoView to align the element with the top of the Web page.
.NET Framework
Available since 2.0
Available since 2.0
Show: