Reputation:
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!
Upvotes: 4
Views: 19535
Reputation: 1
Yes! I've found a way to do this without creating a custom class. It's a bit of a pain though.
You can actually paste formatted text into the Windows Forms Designer, and it will keep the text formatting in the tool tip. You can use this to create bold or underlined text, or even change the font. It seems that copying text with a set font size freaks it out though
The dialog for you to paste shows up when you click the dropdown arrow on the "ToolTip on [ToolTip Name]" property that shows up in your controls under the "Misc" section.
So, if you wanted to add the tool tip to a specific label, you would open the properties for that label, and then paste your text into the property that's generated for the tool tip inside of there. It's a pretty strange system, but hopefully that made enough sense.
Upvotes: -1
Reputation: 1
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));
Upvotes: -2
Reputation: 140793
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.
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.
Upvotes: 3