标签盒中的换行符 [英] Line break in Label Box

查看:60
本文介绍了标签盒中的换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#在标签框中给换行符?

How can I give line break in label box using C#?

这里是我的代码,可以在标签框中显示数据库中的值:

Here is my code is there to show the values from database in a label box:

protected List<string> restwo;
lblKeyword.Text =  restwo[17];

在这里,我创建了一个列表,用于显示数据库中的数据. restwo 是一个数组变量,我将数组列表中的所有内容分配给label box.在此数组列表中,我正在使用它:

Here I create a list for showing the data from database. restwo is an array variable and I am assigning to label box whatever is in the array list. In this array list, I am using this:

"t, applet, class, money, July, you, clue, collection, Java, add, add, add, club, dildos, class, class, applet, t, your, Java, Java, add, collection"

它将显示一个很长的标签文本.这对我的设计将是一个问题.我想在这里包括一个换行符.我该如何实现?

It will show a very lengthy label text. This will be a problem for my design. Here I want include a line break. How can I achieve this?

推荐答案

在适当的地方使用"\ r \ n" br .例如:在标签的Winforms中

Use "\r\n" or br at appropriate places. for example: In winforms for label

label1.text= "t, applet, class, money, July, you, clue, collection,"+"\r\n"+"Java, add, add, add, club, dildos, class, class, applet, t";

这篇关于标签盒中的换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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