xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrol-e180089f.md
Indicates whether a control automatically wraps words to the beginning of the next line when necessary.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue(true)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual bool WordWrap { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(True)>
Public Overridable Property WordWrap As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true if the control wraps words; otherwise false.
|
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.
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;
}
Imports DevExpress.XtraReports.UI
' ...
Public Function CreateMultilineLabel() As XRLabel
' Create a label.
Dim Label1 As New XRLabel()
' Set the Multiline property to true.
Label1.Multiline = True
' Setting 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." & Microsoft.VisualBasic.ChrW(13) & _
Microsoft.VisualBasic.ChrW(10) & "XtraReports Suite by DevExpress"
Return Label1
End Function
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the WordWrap 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.
reporting-winforms-group-at-runtime/VB/DataGrouping/Form1.vb#L44
Dim labelDetail As XRLabel = New XRLabel With {.LocationF = New System.Drawing.PointF(30, 0)}
labelDetail.WordWrap = False
labelDetail.AutoWidth = True
See Also