Is it possible to format Tooltip-Text (bold, underline… etc)?

▼魔方 西西 提交于 2019-12-19 04:01:55

问题


I want to make some passages of a standard tooltip bold in a WinForms application. Is this possible?

If not, is there a (free) tooltip component that allows me to style them (preferably also border and background)?

Thanks!


回答1:


You can use this type : Balloon tool tip. This let you have some bold title and some color option. You might be able to modify the source to get underline, italic and bold inside the message.

Update:

You can modify the drawing of the ToolTip (and the FONT object of the text). This is how to do it. The code in this link is for the normal ToolTip, not the Balloon I posted above.




回答2:


If you know a little about html, you can just write the tooltip like this:

_toolTip.SetToolTip(button, String.Format("<font face=\"Microsoft Yahei\" color=\"blue\">{0}</font>", Tooltip Text));


来源:https://stackoverflow.com/questions/250774/is-it-possible-to-format-tooltip-text-bold-underline-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!