Is it possible to format Tooltip-Text (bold, under

2019-02-14 16:00发布

问题:

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));