ChrisF
ChrisF

Reputation: 137148

What system colour property do Windows tooltips use for their background colour by default?

I've got a window I popup that I'd like to style the same as the default Windows tooltip.

What system colour should I be setting the BackColor property to? There isn't a TooltipBackColor in the system colours property tab.

Apologies to Jalal Aldeen Saa'd but I'm already using System.Drawing.SystemColors.Info and this doesn't change from the default dull yellow colour when I change theme, but the tooltip backgrounds do, as you can see in this screen shot:

tooltip colours

(It's actually a bug that you can get both the tooltip and the popup visible at the same time)

Upvotes: 6

Views: 4297

Answers (2)

Yahia
Yahia

Reputation: 70369

The windows default is called Info...

EDIT:

If you are in WPF (which supports theming) then according to http://msdn.microsoft.com/de-de/library/system.windows.systemcolors.infocolor%28v=vs.85%29.aspx it is System.Windows.SystemColors.InfoColor this updates automatically with the chosen theme

EDIT 2- for WinForms: it is a bit more complicated... you instanciate a System.Windows.Forms.VisualStyles.VisualStyleRenderer with a VisualStyleElement.ToolTip.Standard.Normal and then you can call GetColor on the renderer with System.Windows.Forms.VisualStyles.ColorProperty.FillColor that gives you the current theme backgoundcolor of a tooltip

Upvotes: 6

Jalal Said
Jalal Said

Reputation: 16162

System.Drawing.SystemColors.Info

You can get it by new System.Windows.Forms.ToolTip().BackColor

Upvotes: 2

Related Questions