Skip to main content
A newer version of this page is available. .

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.v19.1.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.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;
}
See Also