内容简介:翻译自:https://stackoverflow.com/questions/15337675/how-do-i-make-a-label-control-truncate-long-strings-with-an-ellipsis
我有一个带有更改文本的标签,我希望它是一个固定长度的单行.每当文本长度超过标签长度时,我希望它显示最后与“…”匹配的内容.例如:
Some Very Long Text
看起来像:
Some Very Lon...
有谁知道这是怎么做到的吗?
其中一个选项是将 Label.AutoEllipsis
设置为true.
Set AutoEllipsis to true to display text that extends beyond the width of the Label when the user passes over the control with the mouse. If AutoSize is true, the label will grow to fit the text and an ellipsis will not appear.
因此,您需要将AutoSize设置为false.省略号外观取决于标签的固定宽度. AFAIK,您需要手动处理文本更改以使其依赖于文本长度.
翻译自:https://stackoverflow.com/questions/15337675/how-do-i-make-a-label-control-truncate-long-strings-with-an-ellipsis
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Practical JavaScript, DOM Scripting and Ajax Projects
Frank Zammetti / Apress / April 16, 2007 / $44.99
http://www.amazon.com/exec/obidos/tg/detail/-/1590598164/ Book Description Practical JavaScript, DOM, and Ajax Projects is ideal for web developers already experienced in JavaScript who want to ......一起来看看 《Practical JavaScript, DOM Scripting and Ajax Projects》 这本书的介绍吧!
在线进制转换器
各进制数互转换器
RGB HSV 转换
RGB HSV 互转工具