Reputation:
I have a Label just displaying a title.
How can I justify the text? and how can I distribute the text? Can I use a label or do I have to use another control?
Upvotes: 2
Views: 4671
Reputation: 78
As Matt said you can only apply the Justify
property on TextBlock
, so the way to go is to put the TextBlock
inside of the Label
as below:
<Label
Grid.Row="2"
Grid.Column="2"
Grid.ColumnSpan="4"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="26">
<TextBlock
TextWrapping="Wrap"
Text="Sample Text"
TextAlignment="Justify"/>
</Label>
Upvotes: 0
Reputation: 768
Label
doesn't have any text alignment property, however TextBlock
does have text alignment properties so you can use justify if that's what you're looking for:
<TextBlock TextAlignment="Justify" />
Upvotes: 3