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

Posted by jp2code on Stack Overflow See other posts from Stack Overflow or by jp2code
Published on 2010-04-14T13:50:34Z Indexed on 2010/04/14 13:53 UTC
Read the original article Hit count: 235

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about themes

Related posts about colors