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

XRControl.WordWrap Property

Indicates whether a control automatically wraps words to the beginning of the next line when necessary.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(true)]
public virtual bool WordWrap { get; set; }

Property Value

Type Default Description
Boolean **true**

true if the control wraps words; otherwise false.

Remarks

A multiline control can display more than one line of text. If the WordWrap property is set to true, text entered into the multiline control is wrapped to the next line in case it doesn’t fit the line or comes across a newline character. If the WordWrap property is set to false, text entered into the multiline control appears on the same line until a newline character occurs.

Not all descendants of the XRControl class use the WordWrap property. For example, the Band class descendants ignore the WordWrap property.

Note

As the reporting engine implements its own word wrapping algorithm, a report in Preview mode may differ from the same report exported to a PDF file.

Example

The following example uses an instance of the XRLabel class (which is derived from the XRControl), to create a multiline text label. This is achieved by using the XRLabel.Multiline and XRControl.WordWrap properties.

using DevExpress.XtraReports.UI;
// ...

public XRLabel CreateMultilineLabel(){
   // Create a label.
   XRLabel label1 = new XRLabel();

   // Set the Multiline property to true.
   label1.Multiline = true;

   // Set the WordWrap to true to allow text to wrap to the next line.
   label1.WordWrap = true;

   // Specify the label's text.
   label1.Text = "The Future of .NET Reporting is Here.\r\nXtraReports Suite by DevExpress";

   return label1;
}
See Also