Xceed Grid for WinForms v4.3 Documentation
WinHorizontalScrollBar control

Welcome to Xceed Grid for WinForms v4.3 > Basic Concepts > Editor Controls > WinHorizontalScrollBar control

The WinHorizontalScrollBar class represents an extensible and themable Horizontal scrollbar for Windows Forms. It supports both Windows XP and classic Windows themes and can adapt to the current Windows theme. 

Background and foreground colors

When the scrollbar's UIStyle property is set to WindowsClassic, the BackColor and ForeColor properties can be set to change the background and foreground colors of the scrollbar. 

VB.NET Copy Code

' Set the scrollbar's UIStyle property to WindowsClassic
WinHorizontalScrollBar1.UIStyle = Xceed.UI.UIStyle.WindowsClassic 

' Change the background and foreground colors
WinHorizontalScrollBar1.BackColor = Color.CornflowerBlue
WinHorizontalScrollBar1.ForeColor = Color.White

C# Copy Code

// Set the scrollbar's UIStyle property to WindowsClassic
winHorizontalScrollBar1.UIStyle = Xceed.UI.UIStyle.WindowsClassic; 

// Change the background and foreground colors
winHorizontalScrollBar1.BackColor = Color.CornflowerBlue;
winHorizontalScrollBar1.ForeColor = Color.White;

The values of the BackColor and ForeColor properties are not taken into consideration when the UIStyle property is set to WindowsXP. If UIStyle is set to System, the colors assigned to the BackColor and ForeColor properties will only be applied to the scrollbar if the system is in Windows Classic style.