SystemColors Class

 

Each property of the SystemColors class is a Color structure that is the color of a Windows display element.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

System.Object
  System.Drawing.SystemColors

public sealed class SystemColors

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticActiveBorder

Gets a Color structure that is the color of the active window's border.

System_CAPS_pubpropertySystem_CAPS_staticActiveCaption

Gets a Color structure that is the color of the background of the active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticActiveCaptionText

Gets a Color structure that is the color of the text in the active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticAppWorkspace

Gets a Color structure that is the color of the application workspace.

System_CAPS_pubpropertySystem_CAPS_staticButtonFace

Gets a Color structure that is the face color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticButtonHighlight

Gets a Color structure that is the highlight color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticButtonShadow

Gets a Color structure that is the shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControl

Gets a Color structure that is the face color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlDark

Gets a Color structure that is the shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlDarkDark

Gets a Color structure that is the dark shadow color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlLight

Gets a Color structure that is the light color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlLightLight

Gets a Color structure that is the highlight color of a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticControlText

Gets a Color structure that is the color of text in a 3-D element.

System_CAPS_pubpropertySystem_CAPS_staticDesktop

Gets a Color structure that is the color of the desktop.

System_CAPS_pubpropertySystem_CAPS_staticGradientActiveCaption

Gets a Color structure that is the lightest color in the color gradient of an active window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticGradientInactiveCaption

Gets a Color structure that is the lightest color in the color gradient of an inactive window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticGrayText

Gets a Color structure that is the color of dimmed text.

System_CAPS_pubpropertySystem_CAPS_staticHighlight

Gets a Color structure that is the color of the background of selected items.

System_CAPS_pubpropertySystem_CAPS_staticHighlightText

Gets a Color structure that is the color of the text of selected items.

System_CAPS_pubpropertySystem_CAPS_staticHotTrack

Gets a Color structure that is the color used to designate a hot-tracked item.

System_CAPS_pubpropertySystem_CAPS_staticInactiveBorder

Gets a Color structure that is the color of an inactive window's border.

System_CAPS_pubpropertySystem_CAPS_staticInactiveCaption

Gets a Color structure that is the color of the background of an inactive window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticInactiveCaptionText

Gets a Color structure that is the color of the text in an inactive window's title bar.

System_CAPS_pubpropertySystem_CAPS_staticInfo

Gets a Color structure that is the color of the background of a ToolTip.

System_CAPS_pubpropertySystem_CAPS_staticInfoText

Gets a Color structure that is the color of the text of a ToolTip.

System_CAPS_pubpropertySystem_CAPS_staticMenu

Gets a Color structure that is the color of a menu's background.

System_CAPS_pubpropertySystem_CAPS_staticMenuBar

Gets a Color structure that is the color of the background of a menu bar.

System_CAPS_pubpropertySystem_CAPS_staticMenuHighlight

Gets a Color structure that is the color used to highlight menu items when the menu appears as a flat menu.

System_CAPS_pubpropertySystem_CAPS_staticMenuText

Gets a Color structure that is the color of a menu's text.

System_CAPS_pubpropertySystem_CAPS_staticScrollBar

Gets a Color structure that is the color of the background of a scroll bar.

System_CAPS_pubpropertySystem_CAPS_staticWindow

Gets a Color structure that is the color of the background in the client area of a window.

System_CAPS_pubpropertySystem_CAPS_staticWindowFrame

Gets a Color structure that is the color of a window frame.

System_CAPS_pubpropertySystem_CAPS_staticWindowText

Gets a Color structure that is the color of the text in the client area of a window.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Better performance is achieved by using the properties of the SystemPens or SystemBrushes classes rather than creating a new pen or brush based on a value from SystemColors. For example, if you wanted to get a brush for the face color of a 3-D element, use the SystemBrushes.Control property because it gets a brush that already exists, whereas calling the SolidBrush constructor with a parameter value of SystemColors.Control will create a new brush.

The following code example demonstrates the Equality operator and the SystemColors class. This example is designed to be used with a Windows Form that contains a button named Button1. Paste the following code into your form and associate the Button1_Click method with the button's Click event.

private void Button1_Click(System.Object sender, System.EventArgs e)
{

    if (this.BackColor == SystemColors.ControlDark)
    {
        this.BackColor = SystemColors.Control;
    }
}

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: