RichTextBlock.MaxLines Property

Definition

Gets or sets the maximum lines of text shown in the RichTextBlock.

C#
public int MaxLines { get; set; }
XAML
<RichTextBlock MaxLines="int"/>

Property Value

Int32

The maximum lines of text shown in the RichTextBlock. The default is 0, which is a special value that represents "Auto" behavior. The value cannot be negative.

Remarks

Use the MaxLines property to specify the maximum lines of text shown in a text block. The text control will adjust it’s height to show no more than the specified number of lines, regardless of the font size, font style, or text length.

Negative integer values are invalid, and will cause a run-time exception.

Applies to

Product Versions
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6