当标签大小小于文本长度时,在标签中显示其余文本 [英] Show the rest of the text in label when label size is smaller than text length

查看:74
本文介绍了当标签大小小于文本长度时,在标签中显示其余文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个包含文本的标签,但是标签必须具有固定大小,但文本没有大小写,当您尝试使用 Windows 时,我试图产生 Windows 的行为em>右键单击在文件夹上,然后单击属性以查看完整的路径,但是如果该路径大于标签,则可以突出显示它并移至末尾,您可以看到其余的文字.我该如何使用Winforms c#.谢谢.

Hi I have a label that contain text but the label has to be in fix size but the text doesn't not, I'm trying to produce the behavior of Windows when you for example Right Click on a folder and click on Properties to see the complete path, but if the path was bigger than the label you can highlight it and move to the end and you can see the rest of the text. How can I do this with Winforms c#. thanks.

推荐答案

您可以使用TextBox并将其ReadOnly属性设置为true,将其BorderStyle属性设置为None.

You can use a TextBox and set the ReadOnly property of it to true and its BorderStyle to None.

这篇关于当标签大小小于文本长度时,在标签中显示其余文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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