|
1 | 1 | # How to change scrollbar mode using WPF SkinManager? |
2 | 2 |
|
3 | | -This sample loads [Datagrid](https://help.syncfusion.com/wpf/datagrid/getting-started) and [Chromeless Window](https://help.syncfusion.com/wpf/chromeless-window/getting-started) with compact windows 10 like scrollbar using SkinManager [ScrollBarMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.Theme.html#Syncfusion_SfSkinManager_Theme_ScrollBarMode) property. |
| 3 | +The [SfSkinManager](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.SfSkinManager.html) allows you to apply various scrollbar styles like Windows 10 compact scrollbar, for both Syncfusion<sup>®</sup> and Framework controls using the [ScrollBarMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.Theme.html#Syncfusion_SfSkinManager_Theme_ScrollBarMode) property, which will be available only in [themes supported by theme studio](https://help.syncfusion.com/wpf/themes/skin-manager#themes-list). |
| 4 | + |
| 5 | +The [ScrollBarMode](https://help.syncfusion.com/cr/wpf/Syncfusion.SfSkinManager.ScrollBarMode.html) enum contains the following values: |
| 6 | + |
| 7 | +* `Default` - The ScrollBar will be displayed with the default look of a thumb along with up and down arrow to scroll. |
| 8 | +* `Compact` - The Windows 10 like compact scrollbar will have the look of a thin layer of thumb until the user hovers over the scrollbar area. |
| 9 | + |
| 10 | +N> The `Compact` scrollbar mode is enabled by default in the [WPF Fluent Theme](https://help.syncfusion.com/wpf/themes/fluent-theme) and WPF Windows11 Theme. |
| 11 | + |
| 12 | +This sample demonstrates how to use the `ScrollBarMode` property in a WPF application using Syncfusion's SkinManager. It loads a `DataGrid` and a `Chromeless Window` with compact scrollbar styles, showcasing the visual differences between modes. |
| 13 | + |
| 14 | +## Features |
| 15 | + |
| 16 | +- Configurable scrollbar modes: Default and Compact |
| 17 | +- Applies to both Syncfusion controls (e.g., SfDataGrid) and standard WPF controls |
| 18 | +- Easy integration with theme applications |
| 19 | +- Hover-to-expand functionality in Compact mode for better usability |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +### Setting ScrollBarMode in C# |
| 24 | + |
| 25 | +To set the ScrollBarMode programmatically, use the SfSkinManager: |
| 26 | + |
| 27 | +```csharp |
| 28 | +using Syncfusion.SfSkinManager; |
| 29 | + |
| 30 | +SfSkinManager.SetTheme(this, new Theme() { ThemeName = "MaterialDark" }); |
| 31 | +SkinManagerHelper.SetScrollBarMode(this, ScrollBarMode.Compact); |
| 32 | +``` |
| 33 | + |
| 34 | +## Build and Run |
| 35 | + |
| 36 | +1. Clone or download the project. |
| 37 | +2. Open `DataGrid_Themes.sln` in Visual Studio. |
| 38 | +3. Restore NuGet packages. |
| 39 | +4. Build the solution. |
| 40 | +5. Run the application to see the DataGrid and Chromeless Window with compact scrollbars. |
| 41 | + |
| 42 | +Ensure Syncfusion licenses are configured if required. |
| 43 | + |
| 44 | +## Demos and Examples |
| 45 | + |
| 46 | +The sample includes a DataGrid populated with employee data, demonstrating scrollbar functionality. Experiment by switching between Default and Compact modes in code. |
| 47 | + |
| 48 | +## Screenshots |
4 | 49 |
|
5 | 50 |  |
| 51 | +1096 |
0 commit comments