Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Color is the Windows' System.Control? (Visual Studio Design View)

In Visual Studio Design View, the selection of Form Colors in the Properties Pane are selectable from the "Custom", "Web", and "System" tabs. Of course, the color number can be used, too.

When the "System" Tab is selected, the colors in the list depend on what type of Theme the Computer User has set on the PC.

I'd like to stick with this, but I need to know how to "read in" the colors. I have controls that I create "on-the-fly" or often need to change a color back after getting the person's attention using a blink/flicker technique.

How do I get the list of System Theme colors?

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.

I've managed to grab a color by physically reading the ARGB value in code, but I'd rather have a way to access the colors by their Theme Name, if that can be done.

public Form1()
{
  Color cControl = this.BackColor;
  Console.WriteLine(cControl.Name); // there is not always a name!
}

Does anyone know what I'm talking about?

like image 619
jp2code Avatar asked Apr 14 '10 13:04

jp2code


1 Answers

From the sounds of your question, you're looking for:

System.Drawing.SystemColors which will give you a full list of the system colors by name.

like image 133
lxalln Avatar answered Sep 30 '22 00:09

lxalln