且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

用行显示文字标签在C#中突破

更新时间:2023-12-04 13:36:46

您可以添加HTML < BR /> 在你的字里行间。是这样的:

You may append HTML <br /> in between your lines. Something like:

MyLabel.Text = "SomeText asdfa asd fas df asdf" + "<br />" + "Some more text";

的StringBuilder 您可以试试:

StringBuilder sb = new StringBuilder();
sb.AppendLine("Some text with line one");
sb.AppendLine("Some mpre text with line two");
MyLabel.Text = sb.ToString().Replace(Environment.NewLine, "<br />");