Back to Devexpress

LegendItemCreatingEventHandler Delegate

windowsforms-devexpress-dot-xtramap-8b0acc4e.md

latest2.5 KB
Original Source

LegendItemCreatingEventHandler Delegate

A method that will handle the MapControl.LegendItemCreating event.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
public delegate void LegendItemCreatingEventHandler(
    object sender,
    LegendItemCreatingEventArgs e
);
vb
Public Delegate Sub LegendItemCreatingEventHandler(
    sender As Object,
    e As LegendItemCreatingEventArgs
)

Parameters

NameTypeDescription
senderObject

The event source.

| | e | LegendItemCreatingEventArgs |

A LegendItemCreatingEventArgs object that contains event data.

|

Remarks

When creating a LegendItemCreatingEventHandler delegate, you identify the method that will handle the corresponding event. To associate an event with your event handler, add a delegate instance to this event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see Events and Delegates in MSDN.

Example

To manually customize legend items, implement the MapControl.LegendItemCreating event handler, where you can configure MapLegendItemBase descendant class objects as you wish.

The following instance demonstrates how to do this.

csharp
void map_LegendItemCreating(object sender, LegendItemCreatingEventArgs e) {
    e.Item.Text = String.Format("{0}$", e.Item.Value);
}
vb
Private Sub map_LegendItemCreating(ByVal sender As Object, ByVal e As LegendItemCreatingEventArgs)
    e.Item.Text = String.Format("{0}$", e.Item.Value)
End Sub

See Also

DevExpress.XtraMap Namespace