Search code examples
colors

Using the predefined colors in .NET


Surely this has been asked before but I am not finding the answer so...

I am changing the backColor in a tool strip with code. When I go into the GUI editor for the back color I am presented with pre-named colors. The color I am interested in is "System->Control"

enter image description here

When I try to specify this color in C# code the color "Control" does not exist:

enter image description here

How do I use the predefined colors presented in the GUI editor in my code?


Solution

  • Based on the clue from @MiscellaneousUser in the comments above the proper form appears to be:

    public Color StatusStripColor => SystemColors.Control;