Wednesday, 16 November 2011

WPF TextBlock Control

How to change the line height within a TextBlock

To change the line hight within a TextBlock, you have to set the LineHeight to the desired height (in logical units) and also the LineStackingStrategy to BlockLineHeight, because otherwhise you will not see any effect.
 
<TextBlock Text="This is a 
multiline text." 
           LineHeight="25" LineStackingStrategy="BlockLineHeight" />

No comments:

Post a Comment