windowsforms-devexpress-dot-xtraeditors-dot-htmlcontentcontrol-dot-findelementsbytag-x28-system-dot-string-x29.md
Returns a list of HTML elements that have the specified tag.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public IEnumerable<DxHtmlElement> FindElementsByTag(
string name
)
Public Function FindElementsByTag(
name As String
) As IEnumerable(Of DxHtmlElement)
| Name | Type | Description |
|---|---|---|
| name | String |
The tag of HTML elements to be retrieved.
|
| Type | Description |
|---|---|
| IEnumerable<DxHtmlElement> |
A list of HTML elements that have the specified tag.
|
The FindElementsByTag method allows you to retrieve HTML elements (DxHtmlElement objects) that have the specified tag. A DxHtmlElement object exposes properties that you can use to change element display settings in code. The main properties include:
Hidden — Allows you to hide the element.Style — Allows you to modify CSS style properties applied to the element. This object exposes the SetBackgroundColor, SetForeColor, and SetProperty methods for this purpose.The following code locates and hides images (elements defined by the ‘img’ tag):
var elements = htmlContentControl.FindElementsByTag("img");
foreach (DxHtmlElement el in elements) {
el.Hidden = true;
}
Dim elements = htmlContentControl.FindElementsByTag("img")
For Each el As DxHtmlElement In elements
el.Hidden = True
Next el
See the following topic for information on how to customize HTML elements with a specific ID in CSS code: CSS Styles - Tag Selector.
See Also