开发者

Winform AutoEllipsis Width

开发者 https://www.devze.com 2022-12-25 07:02 出处:网络
I have a Winform label control with AutoEllipsis set to True.The label itself has a max size set and AutoSize set to false.

I have a Winform label control with AutoEllipsis set to True. The label itself has a max size set and AutoSize set to false.

When text extends the width of the label an ellipsis is displayed (...) and a too开发者_运维技巧l 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...

0

精彩评论

暂无评论...
验证码 换一张
取 消