C# 多行工具提示文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/347092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 00:00:51  来源:igfitidea点击:

Multiline tooltipText

c#winforms

提问by leora

I am trying to have a tooltip on multiple lines. how do i do this?

我试图在多行上有一个工具提示。我该怎么做呢?

采纳答案by JaredPar

Put a newline (use Environment.NewLine) into the actual tooltip text.

将换行符(使用Environment.NewLine)放入实际的工具提示文本中。

回答by BlueRaja - Danny Pflughoeft

You can enter a newline in the designer also (for static-text only, obviously)by clicking the dropdown arrow near the tooltip property-box, and hitting enter where you want the newline.

您也可以通过单击工具提示属性框附近的下拉箭头在设计器中输入换行符(显然仅适用于静态文本),然后在您想要换行符的位置点击输入。

回答by Aaron B.

Just for reference, in C++, one can simply add the "\n" tag directly in static text.

仅供参考,在C++中,可以直接在静态文本中添加“\n”标签。