简体   繁体   English

Winform AutoEllipsis宽度

[英]Winform AutoEllipsis Width

I have a Winform label control with AutoEllipsis set to True. 我有一个Winform标签控件,AutoEllipsis设置为True。 The label itself has a max size set and AutoSize set to false. 标签本身设置了最大尺寸,AutoSize设置为false。

When text extends the width of the label an ellipsis is displayed (...) and a tool tip appears on hover. 当文本扩展标签的宽度时,将显示省略号(...)并在悬停时显示工具提示。 This is great but the resulting toolip is too long. 这很好但是生成的工具包太长了。 Is there anyway to control how the tooltip appears? 无论如何都要控制工具提示的显示方式? Ideally I'd like to set a max width on the actual tooltip and have the text wrap within it. 理想情况下,我想在实际工具提示上设置最大宽度,并在其中包含文本。

Any ideas? 有任何想法吗?

You can start a new line: 您可以开始新的一行:

       this.toolTip1.SetToolTip(this.button1, "Test 1" + System.Environment.NewLine + "Test 2");

I don't see any way to control the size. 我没有看到任何控制尺寸的方法。 You could probably do it with an Owner draw version, there are some examples of Owner Drawn tooltip controls available on the web... 您可以使用所有者绘制版本来执行此操作,在Web上可以使用所有者绘制的工具提示控件的一些示例...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM