Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AxisScrollBar Class
Collapse the table of content
Expand the table of content

AxisScrollBar Class

.NET Framework 4.6 and 4.5

Represents the scrollbar of a chart axis.


Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

public class AxisScrollBar : IDisposable

The AxisScrollBar type exposes the following members.

Public methodAxisScrollBarInitializes a new instance of the AxisScrollBar class.

Public propertyAxisGets the Axis object that uses the scrollbar.
Public propertyBackColorGets or sets the background color of a scrollbar.
Public propertyButtonColorGets or sets the color of the scrollbar buttons.
Public propertyButtonStyleGets or sets the style of the scrollbar button.
Public propertyChartAreaGets the chart area that contains this scrollbar.
Public propertyEnabledGets or sets a flag that determines whether a scrollbar is enabled.
Public propertyIsPositionedInsideGets or sets a flag that indicates whether scroll bar is positioned inside or outside the chart area.
Public propertyIsVisibleGets a flag that indicates whether the scrollbar is visible.
Public propertyLineColorGets or sets the line color of a scrollbar.
Public propertySizeGets or sets the width of a scrollbar, in pixels.

Public methodDispose()Releases all resources used by the current instance of the AxisScrollBar.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the AxisScrollBar class and optionally releases the managed resources.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

The AxisScrollBar class is exposed as the ScrollBar property of the Axis class.

Scrollbars allow the end user to scroll through data when a subset of data is being displayed. A subset of data is referred to as a view, and is represented by the AxisScaleView class.

Scrollbars are only shown when zooming occurs. In other words, even if a scrollbar is enabled, it will only be visible when a view is being displayed.

Important noteImportant

To fix the position of scrollbars, the plotting area position of a chart area must not be set to Auto. To explicitly set the plotting area position, use the InnerPlotPosition property.

To display scrollbars when a chart is first displayed, use the AxisScaleView class properties and methods so that a view is initially displayed to end users.

The background color, button color and width of scrollbars can be set using this AxisScrollBar class.

Note that there are two main types of scrolling: large scrolling, which occurs when the end user clicks in the background of a scrollbar—that is, that part of a scrollbar not covered by the thumb; and small scrolling, which occurs when the end user clicks a left/right or up/down button. To control the large scrolling size, use the Size property of the ScaleView object. To set the small scrolling size, use the SmallScrollSize property of the AxisScaleView class.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft