Back to Devexpress

How to: Customize the Appearance of a Pane's Scroll Bar (Runtime Sample)

windowsforms-5862-controls-and-libraries-chart-control-examples-creating-charts-appearance-customization-how-to-customize-the-appearance-of-a-panes-scroll-bar-runtime-sample.md

latest1.5 KB
Original Source

How to: Customize the Appearance of a Pane's Scroll Bar (Runtime Sample)

  • Jan 15, 2024

This example demonstrates how the appearance of a pane‘s scroll bar can be customized.

Note that for a pane, it’s possible to individually adjust the position and visibility of its X and Y-axis’ scroll bars.

csharp
ScrollBarOptions scrollBarOptions = diagram.DefaultPane.ScrollBarOptions;

scrollBarOptions.BackColor = Color.White;
scrollBarOptions.BarColor = Color.Blue;
scrollBarOptions.BorderColor = Color.Navy;
scrollBarOptions.BarThickness = 15;
scrollBarOptions.XAxisScrollBarAlignment = ScrollBarAlignment.Far;
scrollBarOptions.XAxisScrollBarVisible = true;
vb
Dim scrollBarOptions As ScrollBarOptions = diagram.DefaultPane.ScrollBarOptions

scrollBarOptions.BackColor = Color.White
scrollBarOptions.BarColor = Color.Blue
scrollBarOptions.BorderColor = Color.Navy
scrollBarOptions.BarThickness = 15
scrollBarOptions.XAxisScrollBarAlignment = ScrollBarAlignment.Far
scrollBarOptions.XAxisScrollBarVisible = True

The result is shown in the following image.

See Also

Panes

Axis Ranges