45
votes

I am using WPF, there is a TextBlock in my UserControl. The Text is very long, so I wrap it with TextWrapping = Wrap. The question is, how can I change the line spacing?

The code is something like:

<TextBlock Text="abcdefghijklmn" TextWrapping="Wrap"/>

The output is like:

abcdefghijk
lmn

What I want is:

abcdefghijk
<--increase this line spacing-->
lmn

Great Thanks.

1
You could use Glyphs as suggested here? Otherwise you could adapt the Lineheight and see if that works.Rachel Gallen

1 Answers

79
votes

Use LineHeight together with LineStackingStrategy="BlockLineHeight"

Like

<TextBlock Text="abcdefghijklmn" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="30"/>

(credz Mixer for the BlockLineHeight addition)