LineHeight Property
Collapse the table of content
Expand the table of content

Block.LineHeight Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the height of each line of content.

Namespace:  System.Windows.Documents
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Public Property LineHeight As Double

Property Value

Type: System.Double
The height of each line in pixels. A value of 0 indicates that the line height is determined automatically from the current font characteristics. The default is 0.

Changing the LineHeight value does not change the height of the associated text. Instead, it changes the height of the line that contains the text. To change the size of the text, use the FontSize property.

The layout of lines in a Block element is affected by this property and by the LineStackingStrategy property. This property is used to set the height of each line containing text when LineStackingStrategy property is set to BlockLineHeight or BaselineToBaseline. When LineStackingStrategy property is set to MaxHeight, the larger of calculated LineHeight or set value of LineHeight property is set as the LineHeight.

If LineHeight properties of a RichTextBox and its Block element differs, the LineHeight property of the Block will be honored.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft