Dundas Chart for Windows Forms
Handled Property
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > ScrollBarEventArgs Class : Handled Property


Gets a boolean value that determines if further event handling is performed by the chart control.
Indicates that event is handled by user and no further processing is required.

Syntax

Visual Basic (Declaration)  
Public Property Handled As Boolean
Visual Basic (Usage) Copy Code
Dim instance As ScrollBarEventArgs
Dim value As Boolean
 
instance.Handled = value
 
value = instance.Handled
C#  
public bool Handled {get; set;}

Return Value

If true then default handling of the AxisScrollBarClicked event will occur after the code in the event finishes executing.  If false then default handling of the event will not occur.

Example

In this example we override the default behavior when the user clicks on the reset button.  Normally clicking on the reset button will result in the previous view being displayed, but using the AxisScrollBarClicked event we reset the view to its original state (i.e. no zooming).  We only do this for the X axis of a chart area named "Default".
C# Copy Code
// Note that events in C# should be added via the Events button in the Properties window, so
//   that the necessary code is added to InitializeComponent()
private void chart1_AxisScrollBarClicked(object sender, Dundas.Charting.WinControl.ScrollBarEventArgs e)
{

   
// First check for zoom/reset button being clicked for X axis in chart area named "Default"
   
if(e.ChartArea.Name == "Default")
   {
       
if(e.Axis.Type == AxisName.X)
       {
           
if(e.ButtonType == ScrollBarButtonType.ZoomReset)
           {
               
// Reset view to original view (no zooming)
               
e.Axis.View.ZoomReset(0);
               
               
// further handling of event is not required
               
e.Handled = true;
           }
       }
   }
}
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

Private Sub chart1_AxisScrollBarClicked(ByVal sender As Object, _
ByVal e As Dundas.Charting.WinControl.ScrollBarEventArgs) Handles chart1.AxisScrollBarClicked

    'first check for zoom/reset button being clicked for X axis in chart area named "Default"
    If e.ChartArea.Name = "Default" Then

        If e.Axis.Type = AxisName.X Then

            If e.ButtonType = ScrollBarButtonType.ZoomReset Then

                ' Reset view to original view (no zooming)
                e.Axis.View.ZoomReset(0)

                ' further handling of event is not required
                e.Handled = True
            End If
        End If
    End If
End Sub

Remarks

This property is exposed in the AxisScrollBarClicked event of the root Chart object.

Clicking on a scrollbar button results in default manipulation of the view.  The following is a summary of this default behavior:

  • clicking on the reset/zoom button results in the previous view being displayed.
  • clicking in the scrollbar background (i.e. not on the scrolling thumb, otherwise known as the tracker) results in large increments/decrements, with the increment/decrement size being determined by the Size property. 

To turn off these default behaviors set the Handled property to TRUE after providing custom logic in the AxisScrollBarClicked event (see sample code below).

Requirements

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

See Also

© 2009 All Rights Reserved.