增加新的生产线来标记 [英] Adding new line to label

查看:135
本文介绍了增加新的生产线来标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从数据库中获取的数据,并显示在标签上的数据。我要申请新的生产线的标签,每35 charecters文本。由于35 charecters后的文字溢出。

I get the data from the database and display that data on the label. I have to apply new line on the text of the label for every 35 charecters. Because after 35 charecters the text overflows.

您可以请让我知道如何做到这一点。

Can you please let me know how to do this.

推荐答案

只是改变标签的样式,以便它会自动换行:

Just change the style of the label so it will wrap the text:

style=" width:50px; overflow-y:auto;overflow-x:auto; word-break:break-all;"

更重要的是,把它放进你的CSS文件,而不是直接的控制。

Better yet, put this in your CSS file rather than directly on the control.

另一种选择,如果你不喜欢这个,就是用一个文本框和风格它作为一个标签,在的这个职务。

Another option, if you don't like this, is to use a textbox and style it as a label, as described in this post.

这篇关于增加新的生产线来标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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