Skip to main content

XRLabel.Multiline Property

Gets or sets whether carriage return (CRLF) characters split the label’s text into multiple lines.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public bool Multiline { get; set; }

Property Value

Type Default Description
Boolean false

true, if carriage return (CRLF) characters split the label’s text into multiple lines ; otherwise, false.

Remarks

Set this property’s value to true (process carriage returns) to display more than one line of text in an XRLabel control.

The following can be used as new line characters:

  • NewLine.
  • ControlChars.CrLf.
  • vbCrLf (Visual Basic only).

Example

The code sample below illustrates how to display multiline text in an XRLabel control.

xrlabel-multiline

using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
public XRLabel CreateLabel() {
    // Create a new label object. 
    XRLabel label = new XRLabel();

    // Enable the multiline content.
    label.Multiline = true;
    label.Text = "This text illustrates \r\nhow to use the XRLabel.Multiline property \r\nto display multiline content \r\nin a label.";

    // Align the label's text to the middle.
    label.TextAlignment = TextAlignment.MiddleCenter;

    return label;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Multiline property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also