Please take a look at this picture:
I try to create same label with 2 sizes:
<Grid>
<Label Content="11" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="50" />
<Label Content="%" HorizontalAlignment="Right" FontSize="20"
VerticalAlignment="Top"/>
</Grid>
But currently this is not like the picture:
To have such a result, your grid must be really small. I see at least 3 solutions to your issue:
1- Make your grid a bit bigger until it fits.
2- Put 2 columns in your grid, you'd put the number on the left column and the % on the right columns.
3- You could use a StackPanel like this:
<Grid>
<StackPanel Orientation="Horizontal">
<Label Content="11" FontSize="50" Padding="0"/>
<Label Content="%" FontSize="20" VerticalAlignment="Top" Padding="0,10,5,5"/>
</StackPanel>
</Grid>
EDIT:
<Grid>
<StackPanel Orientation="Veritical">
<StackPanel Orientation="Horizontal">
<Label Content="11" FontSize="50" Padding="0"/>
<Label Content="%" FontSize="20" VerticalAlignment="Top" Padding="0,10,5,5"/>
</StackPanel>
<Label Content="Storage">
</StackPanel>
</Grid>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.