corelibraries-devexpress-dot-utils-dot-html-dot-dxhtmlelementeventargs.md
Returns the unique identifier of an HTML element. Element IDs are set in HTML markup (the “id” property). See any “HtmlElementMouse~” event description for more information (for example, WinExplorerView.HtmlElementMouseClick).
Namespace : DevExpress.Utils.Html
Assembly : DevExpress.Data.Desktop.v25.2.dll
NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
public string ElementId { get; }
Public ReadOnly Property ElementId As String
| Type | Description |
|---|---|
| String |
The unique identifier of an HTML element.
|
The code below illustrates how to identify elements and perform different actions for each.
<div class='buttonPanel'>
</div>
htmlContentControl.ElementMouseClick += (s, e) => {
if(e.ElementId == "btnPhone")
// Action #1
if(e.ElementId == "btnVideo")
// Action #2
if(e.ElementId == "btnText")
// Action #3
};
AddHandler htmlContentControl.ElementMouseClick, Sub(s, e)
If e.ElementId = "btnPhone" Then
' Action #1
End If
If e.ElementId = "btnVideo" Then
' Action #2
End If
If e.ElementId = "btnText" Then
' Action #3
End If
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ElementId property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-chat-for-net-framework/CS/DevExpress.AI.WinForms.HtmlChat/ChatControl.cs#L107
{
if (e.ElementId == "btnSend")
{
See Also