How to change scrollbar button width and color?

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 3 months ago by Michael Janulaitis - Corner Bowl Software
Avatar

Most of my users have a very hard time finding the skinner scrollbars.  I have updated my WPF actipro app to use a modified version default scrollbar.  The only difference is the color.  I would like to do the same for my Avalonia app.  How can I override the theme to either use the default and change the color or change the width/height and the color?

Comments (1)

Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you wanted to increase the scrollbar thumb barrel width ("ascent"), you can do this in your Application.Styles, which increases the thumb barrel width from 4 to 8:

<actipro:ModernTheme Includes="All">
	<actipro:ModernTheme.Definition>
		<generation:ThemeDefinition ScrollBarThumbMaxAscent="8" />
	</actipro:ModernTheme.Definition>
</actipro:ModernTheme>

Note that this value just affects how wide the dark thumb barrel is rendered.  You can interact with the thumb itself over the full width of the scrollbar, no matter what thumb barrel width is used.

The ScrollBarThumbBackgroundBrushHorizontal, ScrollBarThumbBackgroundBrushHorizontalPointerOver, ScrollBarThumbBackgroundBrushHorizontalPressed, and related "Vertical" brush resources are used to render the thumb.  See this documentation topic for information on how to override resources.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.