Search
HtmlBuilder.CreatingArea Event
See Also
 





Raised just before a new AREA tag is added to the image map.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public event EventHandler<AreaEventArgs> CreatingArea

Visual Basic  Copy Code

Public Event CreatingArea As EventHandler(Of AreaEventArgs)

 Event Data

CreatingArea event handlers receive an argument of type AreaEventArgs. The following AreaEventArgs members provide information relevant to the event:

Member name

Description

AreaTag

The HTML AREA tag created by HtmlBuilder.

Item

The diagram element represented by AreaTag in the image map.

Column

Contains the index of a column if the event is raised for a table cell.

Row

Contains the index of a row if the event is raised for a table cell.

 Remarks

You could handle this event in order to insert additional attributes or JavaScript event handlers into the AREA tag. The tag string already ends with a closing ">" when the event is raised, so you must insert any additional attributes one character before the end of the tag string.

 Example

The following code adds a JavaScript onClick event handler to the area tag:

C#  Copy Code

private void htb_CreatingArea(object sender, AreaEventArgs e)
{
    string script = " onClick=\"alert('click click')\"";
    e.AreaTag = e.AreaTag.Insert(e.AreaTag.Length - 1, script);
}

Visual Basic  Copy Code

Private Sub htb_CreatingArea(ByVal sender As Object, ByVal e As AreaEventArgs)

    Dim script As String = " onClick=" + Chr(34) + "alert('click click')" + Chr(34)
    e.AreaTag = e.AreaTag.Insert(e.AreaTag.Length - 1, script)

End Sub

 See Also