Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 713
Sergio Tapia Avatar asked Oct 21 '09 13:10

Sergio Tapia


People also ask

What color is system control?

Most forms have a BackColor that defaults to "Control", which looks like a very light gray under Windows 7, running the default Windows 7 Theme.

Which property is used to set the background color to the button control?

The BackColor property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a Button will have the same BackColor as its parent Form by default.

What is control color?

Color control is the process of controlling color throughout an imaging, print, or manufacturing workflow.


1 Answers

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.

like image 161
stevemegson Avatar answered Oct 01 '22 12:10

stevemegson