pieter_dv
pieter_dv

Reputation: 499

WPF RibbonGroup increased FontSize text cut off

In a WPF 4.5 project I'm trying to adjust the FontSize of my ribbon, but if I increase the FontSize to for example 20, the label of my RibbonGroup label is cut off and not readable:

cut off text

the code I used to create this sample is the following:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow">
    <Grid>
        <Ribbon>
            <RibbonTab Header="Test">
                <RibbonGroup Header="Test" FontSize="20">

                </RibbonGroup>
            </RibbonTab>
        </Ribbon>
    </Grid>
</Window>

(don't forget to include in System.Windows.Controls.Ribbon assembly)

Any ideas how to fix this?

Upvotes: 1

Views: 815

Answers (1)

Suresh
Suresh

Reputation: 4149

This may not be what you want, but you could change the appearance of RibbonGroup Header by providing a HeaderTemplate.

This is what I tried:

<Ribbon>
    <RibbonTab Header="Test">
        <RibbonGroup Header="Test" FontSize="20" >
            <RibbonGroup.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding}" Margin="0,-10,0,0"/>
                </DataTemplate>
            </RibbonGroup.HeaderTemplate>
        </RibbonGroup>
    </RibbonTab>
</Ribbon>

and it appears to be working fine in my test app. However, you may have problems once have some more content in the RibbonGroup.

Upvotes: 3

Related Questions