问题描述
您好,我有一个包含文本的标签,但是标签必须具有固定大小,但文本没有大小写,当您尝试使用 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
.
这篇关于当标签大小小于文本长度时,在标签中显示其余文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!