Chart BeforeDouble ClickByVal ElementID As Long ByVal Arg As Long ByVal Arg As Long Cancel As Boolean

Chart_BeforeDoubleClick occurs when any part of a chart is double-clicked. ElementID is the part of the chart that is double-clicked, such as the Legend; Argl and Arg2 are dependent upon the ElementID; Cancel set to True prevents the default double-click action from occurring.

The following sample hides the legend when it is double-clicked; double-clicking on the chart area brings back the legend:

Private Sub Chart_BeforeDoubleClick(ByVal ElementID As Long, _ ByVal Argl As Long, ByVal Arg2 As Long, Cancel As Boolean) Select Case ElementID Case xlLegend

Me.HasLegend = False Cancel = True Case xlChartArea

Me.HasLegend = True Cancel = True End Select End Sub

0 0

Post a comment