Represents an HTML element inside of a Web page.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Gets an HtmlElementCollection of all elements underneath the current element.
Gets a value indicating whether this element can have child elements.
Gets an HtmlElementCollection of all children of the current element.
Gets the bounds of the client area of the element in the HTML document.
Gets the HtmlDocument to which this element belongs.
Gets an unmanaged interface pointer for this element.
Gets or sets whether the user can input data into this element.
Gets the next element below this element in the document tree.
Gets or sets a label by which to identify the element.
Gets or sets the HTML markup underneath this element.
Gets or sets the text assigned to the element.
Gets or sets the name of the element.
Gets the next element at the same level as this element in the document tree.
Gets the element from which OffsetRectangle is calculated.
Gets the location of an element relative to its parent.
Gets or sets the current element's HTML code.
Gets or sets the current element's text.
Gets the current element's parent element.
Gets or sets the distance between the edge of the element and the left edge of its content.
Gets the dimensions of an element's scrollable region.
Gets or sets the distance between the edge of the element and the top edge of its content.
Gets or sets a semicolon-delimited list of styles for the current element.
Gets or sets the location of this element in the tab order.
Gets the name of the HTML tag.
Adds an element to another element's subtree.
Adds an event handler for a named event on the HTML Document Object Model (DOM).
Removes an event handler from a named event on the HTML Document Object Model (DOM).
Tests if the supplied object is equal to the current element.(Overrides Object::Equals(Object^).)
Puts user input focus on the current element.
Retrieves the value of the named attribute on the element.
Retrieves a collection of elements represented in HTML by the specified HTML tag.
Serves as a hash function for a particular type.(Overrides Object::GetHashCode().)
Insert a new element into the Document Object Model (DOM).
Executes an unexposed method on the underlying DOM element of this element.
Executes a function defined in the current HTML page by a scripting language.
Causes the named event to call all registered event handlers.
Removes focus from the current element, if that element has focus.
Scrolls through the document containing this element until the top or bottom edge of this element is aligned with the document's window.
Sets the value of the named attribute on the element.
Returns a string that represents the current object.(Inherited from Object.)
Occurs when the user clicks on the element with the left mouse button.
Occurs when the user clicks the left mouse button over an element twice, in rapid succession.
Occurs when the user drags text to various locations.
Occurs when a user finishes a drag operation.
Occurs when the user is no longer dragging an item over this element.
Occurs when the user drags text over the element.
Occurs when the element first receives user input focus.
Occurs when the element has received user input focus.
Occurs when the user presses a key on the keyboard.
Occurs when the user presses and releases a key on the keyboard.
Occurs when the user releases a key on the keyboard.
Occurs when the element is losing user input focus.
Occurs when the element has lost user input focus.
Occurs when the user presses a mouse button.
Occurs when the user first moves the mouse cursor over the current element.
Occurs when the user moves the mouse cursor off of the current element.
Occurs when the user moves the mouse cursor across the element.
Occurs when the mouse cursor enters the bounds of the element.
Occurs when the user releases a mouse button.
BODY, TABLE, and FORM, among others. The class exposes the most common properties you can expect to find on all elements.represents any possible type of element in an HTML document, such as
Most elements can have child elements: other HTML elements that are placed underneath them. Use the CanHaveChildren property to test whether a given element has children, and the Children collection to iterate through them. The Parent property returns the in which the current element is nested.
You often need access to attributes, properties, and methods on the underlying element that are not directly exposed by SRC attribute on an IMG element or the Submit method on a FORM. The GetAttribute and SetAttribute methods enable you to retrieve and alter any attribute or property on a specific element, while InvokeMember provides access to any methods not exposed in the managed Document Object Model (DOM). If your application has unmanaged code permission, you can also access unexposed properties and methods with the DomElement attribute., such as the
Use the TagName property to test whether an element is of a specific type.
Any HTML document can be modified at run time. You can create new CreateElement method of HtmlDocument, and add them to another element using the AppendChild or InsertAdjacentElement methods. You can also create the elements as HTML tags and assign them to an existing element's InnerHtml property.objects with the
The following code example shows how to examine an arbitrary HTML document and derive a string describing the HTML elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. This code example requires that your application hosts a WebBrowser control named WebBrowser1.
Available since 2.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.