Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

.net

winforms

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)

like image 224
ChrisF Avatar asked Jul 23 '11 22:07

ChrisF


2 Answers

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

like image 162
Yahia Avatar answered Sep 29 '22 12:09

Yahia


System.Drawing.SystemColors.Info

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

like image 21
Jalal Said Avatar answered Sep 29 '22 10:09

Jalal Said