windowsforms-devexpress-dot-xtramap-8b0acc4e.md
A method that will handle the MapControl.LegendItemCreating event.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public delegate void LegendItemCreatingEventHandler(
object sender,
LegendItemCreatingEventArgs e
);
Public Delegate Sub LegendItemCreatingEventHandler(
sender As Object,
e As LegendItemCreatingEventArgs
)
| Name | Type | Description |
|---|---|---|
| sender | Object |
The event source.
| | e | LegendItemCreatingEventArgs |
A LegendItemCreatingEventArgs object that contains event data.
|
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.
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.
void map_LegendItemCreating(object sender, LegendItemCreatingEventArgs e) {
e.Item.Text = String.Format("{0}$", e.Item.Value);
}
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