HtmlDocument::GetElementFromPoint Method (Point)

 

Retrieves the HTML element located at the specified client coordinates.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
HtmlElement^ GetElementFromPoint(
	Point point
)

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: