Ribbon Group Scroll Button Width

Ribbon for WPF Forum

Posted 5 years ago by Adam Reiger
Version: 17.1.0651


Is there a way to change the width (11px) of the two scroll buttons in the ribbon? They show when the ribbon has nothing else to collapse or all groups in a tab have IsCollapsible="False".


[Modified 5 years ago]

Comments (3)

Answer - Posted 5 years ago by Adam Reiger

Nevermind, I figured it out. Getting the default style of the GroupPresenter then adding a MinWidth to each button did it.

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Adam,

Right now the default style for the ScrollLeftButton is:

<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ribbon:Ribbon},ResourceId=ScrollLeftButton}" TargetType="{x:Type Button}">
	<Setter Property="HorizontalAlignment" Value="Left" />
	<Setter Property="Visibility" Value="Collapsed" />
	<Setter Property="Template">
			<ControlTemplate TargetType="{x:Type Button}">
				<Border x:Name="RibbonGroupScrollButtonBorder" Margin="{TemplateBinding Margin}" 
					Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonTabControlBackgroundNormalBrushKey}}"
					BorderBrush="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonTabControlBorderNormalBrushKey}}" 
					BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,0,0,3" SnapsToDevicePixels="True">
					<Path Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center"
							Fill="{DynamicResource {x:Static themes:AssetResourceKeys.MenuItemPopupGlyphBackgroundNormalBrushKey}}" 
							Data="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type ribbon:Ribbon},ResourceId=MenuScrollViewerLeftArrow}}"/>
					<Trigger Property="IsMouseOver" Value="True">
						<Setter TargetName="RibbonGroupScrollButtonBorder" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ToolBarButtonLargeBackgroundHoverBrushKey}}"/>

You could probably override that Template in a cloned implicit Style in your App.Resources.  The matching ScrollRightButton Style is the same other than using a MenuScrollViewerRightArrow resource in the Path.

Or you could do it how you did it as well.

Actipro Software Support

Posted 5 years ago by Adam Reiger

That works to, thanks.

The latest build of this product (v22.1.3) was released 21 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.