Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Align bottoms of text in controls
Message
De
10/01/2010 19:17:41
 
 
À
10/01/2010 14:22:03
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01442990
Message ID:
01443162
Vues:
35
>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>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform