XRLabel.Multiline 属性 换行

XRLabel.Multiline Property

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

NamespaceDevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

#Declaration

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

#Property Value

TypeDefaultDescription
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

CanGrow

CanShrink

XRLabel Class

XRLabel Members

DevExpress.XtraReports.UI Namespace

Environment.NewLine 属性

获取为此环境定义的换行字符串。

C#复制

public static string NewLine { get; }

属性值

String

对于非 Unix 平台为包含“\r\n”的字符串,对于 Unix 平台则为包含“\n”的字符串。

示例

下面的示例显示了由换行符分隔的三行。

C#复制

// Sample for the Environment.NewLine property
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine();
    Console.WriteLine("NewLine: {0}  first line{0}  second line{0}  third line",
                          Environment.NewLine);
    }
}
/*
This example produces the following results:

NewLine:
  first line
  second line
  third line
*/

注解

NewLine 的属性值是专门为当前平台和实现 .NET Framework 自定义的常量。 有关属性值中转义符的详细信息,请参阅字符转义

NewLine 提供的功能通常由字词换行符、换行符、换行符、回车符、CRLF 和行尾所指。

NewLine 可以与特定于语言的换行符(如 Microsoft C#和 C/C++中的转义符 "\r" 和 "\N",或 microsoft Visual Basic 中 vbCrLf)结合使用。

NewLine 将自动追加到 Console.WriteLine 和 StringBuilder.AppendLine 方法处理的文本上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值