Windows Dev Center

Expand Minimize

RichTextBlock.MaxLines property

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

Syntax


public int MaxLines { get; set; }


<RichTextBlock MaxLines="int"/>

Property value

Type: System.Int32 [.NET] | int32 [C++]

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.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

RichTextBlock

 

 

Show:
© 2015 Microsoft