Dela via


RichTextBlock.MaxLines Property

Definition

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

public:
 property int MaxLines { int get(); void set(int value); };
int MaxLines();

void MaxLines(int value);
public int MaxLines { get; set; }
var int32 = richTextBlock.maxLines;
richTextBlock.maxLines = int32;
Public Property MaxLines As Integer
<RichTextBlock MaxLines="int"/>

Property Value

Int32

int

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