Chart customize map areas event handler delegate.
Visual Basic (Declaration) | |
---|---|
Public Delegate Sub CustomizeMapAreasEventHandler( _ ByVal sender As Chart, _ ByVal e As CustomizeMapAreasEventArgs _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public delegate void CustomizeMapAreasEventHandler( Chart sender, CustomizeMapAreasEventArgs e ) |
Parameters
- sender
-
The root Chart object.
- e
-
A CustomizeMapAreasEventArg object, used to customize the chart's MapArea objects that have been created for a chart element with a non-empty Href, Tooltip or MapAreaAttributes property.
The following sample loops through all map areas that have been created for a chart element, and removes those items that do not have a tooltip.
Visual Basic | Copy Code |
---|---|
Private Sub Chart1_CustomizeMapAreas(ByVal chart As Chart, ByVal e As CustomizeMapAreasEventArgs) _ Handles Chart1.CustomizeMapAreas Dim areaIndex As Integer = 0 While areaIndex < e.MapAreasItems.Count ' remove areas if there is no tooltip set If e.MapAreasItems(areaIndex).ToolTip = String.Empty Then e.MapAreasItems.RemoveAt(areaIndex) areaIndex -= 1 End If areaIndex += 1 End While End Sub |
The declaration of your event handler must have the same parameters as the CustomizeMapAreasEventHandler delegate declaration.
When you create a CustomizeMapAreasEventHandler delegate, you identify the method that will handle the CustomizeMapAreas event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family