How can I call the Control color, I mean the default forms color?

Sergio Tapia picture Sergio Tapia · Oct 21, 2009 · Viewed 78.9k times · Source

For instance, to make something blue I would go:

this.BackColor = Color.LightBlue;

How can I summon the Control color, the khaki one.

Thanks SO.

Answer

stevemegson picture stevemegson · Oct 21, 2009

The System.Drawing.SystemColors class has properties exposing the various system colours, so you can do

this.BackColor = SystemColors.Control;

The full range of properties to access other colours is listed on MSDN.