用行显示文字标签在C#中突破 [英] Display label text with line breaks in c#

查看:139
本文介绍了用行显示文字标签在C#中突破的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以显示与行标签文本完全打破按图像

Is it possible to display the label text with line breaks exactly as per the image

我需要在标签上的文字被精确地打印可以有一个人帮助我,有标签上显示我想要的文字将被储存在一个字符串建设者

I need the text on the label to be printed exactly can some one help me, my desired text that has to be shown on the label will be stored in a string-builder

推荐答案

您可以添加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 />");

这篇关于用行显示文字标签在C#中突破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆