Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Align bottoms of text in controls
Message
From
10/01/2010 19:17:41
 
 
To
10/01/2010 14:22:03
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01442990
Message ID:
01443162
Views:
36
>It doesn't work.
>The bottoms of the texts still don't match.

I think Viv is correct, you want to align baselines not bottoms. This works for me:
<Grid>
  <FlowDocumentReader IsHitTestVisible="False">
    <FlowDocument>
      <Paragraph>Name:<Run FontSize="44">Itzhak Perlman</Run></Paragraph>
    </FlowDocument>
  </FlowDocumentReader>
</Grid>
Edit: That's probably not how your going to want to do it in your app. But that is a way to get WPF to do the alignment work for you.

This is probably the best way to do it in your app, assuming that the font sizes will always be the same:
<StackPanel Orientation="Horizontal">
  <Label Margin="0,33,0,0" Content="Name:"/>
  <Label Content="Itzhak Perlman" FontSize="44"/>
</StackPanel>
Previous
Reply
Map
View

Click here to load this message in the networking platform