Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF How to arrange TextBlock with different Fontsize at bottomline

today i hit a really annoing problem with wpf.

i just want to align Textblock controls(with different fontsize) at the bottom line.

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="ABC" FontSize="12" VerticalAlignment="Bottom"/>
            <TextBlock Text="QWERT" FontSize="24" VerticalAlignment="Bottom"/>
            <TextBlock Text="XYZ" FontSize="18" VerticalAlignment="Bottom"/>
        </StackPanel>

enter image description here

what do i miss?

like image 615
blindmeis Avatar asked Jul 05 '12 08:07

blindmeis


1 Answers

found a workaround. i have to use Run inside my TextBlock

        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock VerticalAlignment="Bottom">
                <Run FontSize="12">ABC</Run>
                <Run FontSize="24">QWERT</Run>
                <Run FontSize="18">XYZ</Run>
            </TextBlock>
        </StackPanel>
like image 128
blindmeis Avatar answered Oct 28 '22 11:10

blindmeis