HtmlDocument.ActiveElement Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Provides the HtmlElement which currently has user input focus.

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

public HtmlElement ActiveElement { get; }

Property Value

Type: System.Windows.Forms.HtmlElement

The HtmlElement which currently has user input focus.

When the document has focus, but no element of the document has been given focus, ActiveElement returns the element corresponding to the <BODY> tag.

If the document does not have focus, ActiveElement returns null.

If the current element with input focus is a cell (TD) in an HTML TABLE tag, ActiveElement will return the element that contains the TABLE element.

.NET Framework
Available since 2.0
Return to top