SystemColors Class
Contains system colors, system brushes, and system resource keys that correspond to system display elements.
Namespace: System.Windows
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
The SystemColors type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | ActiveBorderBrush | Gets a SolidColorBrush that is the color of the active window's border. |
![]() ![]() | ActiveBorderBrushKey | Gets the ResourceKey for the SolidColorBrush used to paint the active window's border. |
![]() ![]() | ActiveBorderColor | Gets a Color structure that is the color of the active window's border. |
![]() ![]() | ActiveBorderColorKey | Gets the ResourceKey for the Color of the active window's border. |
![]() ![]() | ActiveCaptionBrush | Gets a SolidColorBrush that is the color of the background of the active window's title bar. |
![]() ![]() | ActiveCaptionBrushKey | Gets the ResourceKey for the SolidColorBrush used to paint the background of the active window's title bar. |
![]() ![]() | ActiveCaptionColor | Gets a Color structure that is the background color of the active window's title bar. |
![]() ![]() | ActiveCaptionColorKey | Gets the ResourceKey for the background Color of the active window's title bar. |
![]() ![]() | ActiveCaptionTextBrush | Gets a SolidColorBrush that is the color of the text in the active window's title bar. |
![]() ![]() | ActiveCaptionTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the text in the active window's title bar. |
![]() ![]() | ActiveCaptionTextColor | Gets a Color structure that is the color of the text in the active window's title bar. |
![]() ![]() | ActiveCaptionTextColorKey | Gets the ResourceKey for the Color of the text in the active window's title bar. |
![]() ![]() | AppWorkspaceBrush | Gets a SolidColorBrush that is the color of the application workspace. |
![]() ![]() | AppWorkspaceBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the application workspace. |
![]() ![]() | AppWorkspaceColor | Gets a Color structure that is the color of the application workspace. |
![]() ![]() | AppWorkspaceColorKey | Gets the ResourceKey for the Color of the application workspace. |
![]() ![]() | ControlBrush | Gets a SolidColorBrush that is the face color of a three-dimensional display element. |
![]() ![]() | ControlBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the face of a three-dimensional display element. |
![]() ![]() | ControlColor | Gets a Color structure that is the face color of a three-dimensional display element. |
![]() ![]() | ControlColorKey | Gets the ResourceKey for the face Color of a three-dimensional display element. |
![]() ![]() | ControlDarkBrush | Gets a SolidColorBrush that is the shadow color of a three-dimensional display element. |
![]() ![]() | ControlDarkBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the shadow of a three-dimensional display element. |
![]() ![]() | ControlDarkColor | Gets a Color structure that is the shadow color of a three-dimensional display element. |
![]() ![]() | ControlDarkColorKey | Gets the ResourceKey for the shadow Color of a three-dimensional display element. |
![]() ![]() | ControlDarkDarkBrush | Gets a SolidColorBrush that is the dark shadow color of a three-dimensional display element. |
![]() ![]() | ControlDarkDarkBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the dark shadow of a three-dimensional display element. |
![]() ![]() | ControlDarkDarkColor | Gets a Color structure that is the dark shadow color of a three-dimensional display element. |
![]() ![]() | ControlDarkDarkColorKey | Gets the ResourceKey for the dark shadow Color of the highlight color of a three-dimensional display element. |
![]() ![]() | ControlLightBrush | Gets a SolidColorBrush that is the light color of a three-dimensional display element. |
![]() ![]() | ControlLightBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the light area of a three-dimensional display element. |
![]() ![]() | ControlLightColor | Gets a Color structure that is the light color of a three-dimensional display element. |
![]() ![]() | ControlLightColorKey | Gets the ResourceKey for the highlight Color of a three-dimensional display element. |
![]() ![]() | ControlLightLightBrush | Gets a SolidColorBrush that is the highlight color of a three-dimensional display element. |
![]() ![]() | ControlLightLightBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the highlight of a three-dimensional display element. |
![]() ![]() | ControlLightLightColor | Gets a Color structure that is the highlight color of a three-dimensional display element. |
![]() ![]() | ControlLightLightColorKey | Gets the ResourceKey for the highlight Color of a three-dimensional display element. |
![]() ![]() | ControlTextBrush | Gets a SolidColorBrush that is the color of text in a three-dimensional display element. |
![]() ![]() | ControlTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints text in a three-dimensional display element. |
![]() ![]() | ControlTextColor | Gets a Color structure that is the color of text in a three-dimensional display element. |
![]() ![]() | ControlTextColorKey | Gets the ResourceKey for the Color of text in a three-dimensional display element. |
![]() ![]() | DesktopBrush | Gets a SolidColorBrush that is the color of the desktop. |
![]() ![]() | DesktopBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the desktop. |
![]() ![]() | DesktopColor | Gets a Color structure that is the color of the desktop. |
![]() ![]() | DesktopColorKey | Gets the ResourceKey for the Color of the desktop. |
![]() ![]() | GradientActiveCaptionBrush | Gets a SolidColorBrush that is the right side color in the gradient of an active window's title bar. |
![]() ![]() | GradientActiveCaptionBrushKey | Gets the ResourceKey for the SolidColorBrush that is the color of the right side of the gradient of an active window's title bar. |
![]() ![]() | GradientActiveCaptionColor | Gets a Color structure that is the right side color in the gradient of an active window's title bar. |
![]() ![]() | GradientActiveCaptionColorKey | Gets the ResourceKey for the right-side Color in the gradient of an active window's title bar. |
![]() ![]() | GradientInactiveCaptionBrush | Gets a SolidColorBrush that is the right side color in the gradient of an inactive window's title bar. |
![]() ![]() | GradientInactiveCaptionBrushKey | Gets the ResourceKey for the SolidColorBrush that is the color of the right side of the gradient of an inactive window's title bar. |
![]() ![]() | GradientInactiveCaptionColor | Gets a Color structure that is the right side color in the gradient of an inactive window's title bar. |
![]() ![]() | GradientInactiveCaptionColorKey | Gets the ResourceKey for the right-side Color in the gradient of an inactive window's title bar. |
![]() ![]() | GrayTextBrush | Gets a SolidColorBrush that is the color of disabled text. |
![]() ![]() | GrayTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints disabled text. |
![]() ![]() | GrayTextColor | Gets a Color structure that is the color of disabled text. |
![]() ![]() | GrayTextColorKey | Gets the ResourceKey for the Color of disabled text. |
![]() ![]() | HighlightBrush | Gets a SolidColorBrush that paints the background of selected items. |
![]() ![]() | HighlightBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of selected items. |
![]() ![]() | HighlightColor | Gets a Color structure that is the background color of selected items. |
![]() ![]() | HighlightColorKey | Gets the ResourceKey for the background Color of selected items. |
![]() ![]() | HighlightTextBrush | Gets a SolidColorBrush that is the color of the text of selected items. |
![]() ![]() | HighlightTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the text of selected items. |
![]() ![]() | HighlightTextColor | Gets a Color structure that is the color of the text of selected items. |
![]() ![]() | HighlightTextColorKey | Gets the ResourceKey for the Color of a selected item's text. |
![]() ![]() | HotTrackBrush | Gets a SolidColorBrush that is the color used to designate a hot-tracked item. |
![]() ![]() | HotTrackBrushKey | Gets the ResourceKey for the SolidColorBrush that paints hot-tracked items. |
![]() ![]() | HotTrackColor | Gets a Color structure that is the color used to designate a hot-tracked item. |
![]() ![]() | HotTrackColorKey | Gets the ResourceKey for the Color that designates a hot-tracked item. |
![]() ![]() | InactiveBorderBrush | Gets a SolidColorBrush that is the color of an inactive window's border. |
![]() ![]() | InactiveBorderBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the border of an inactive window. |
![]() ![]() | InactiveBorderColor | Gets a Color structure that is the color of an inactive window's border. |
![]() ![]() | InactiveBorderColorKey | Gets the ResourceKey for the Color of an inactive window's border. |
![]() ![]() | InactiveCaptionBrush | Gets a SolidColorBrush that is the background color of an inactive window's title bar. |
![]() ![]() | InactiveCaptionBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of an inactive window's title bar. |
![]() ![]() | InactiveCaptionColor | Gets a Color structure that is the background color of an inactive window's title bar. |
![]() ![]() | InactiveCaptionColorKey | Gets the ResourceKey for the background Color of an inactive window's title bar. |
![]() ![]() | InactiveCaptionTextBrush | Gets a SolidColorBrush that is the color of the text of an inactive window's title bar. |
![]() ![]() | InactiveCaptionTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the text of an inactive window's title bar. |
![]() ![]() | InactiveCaptionTextColor | Gets a Color structure that is the color of the text of an inactive window's title bar. |
![]() ![]() | InactiveCaptionTextColorKey | Gets the ResourceKey for the Color of the text of an inactive window's title bar. |
![]() ![]() | InactiveSelectionHighlightBrush | Gets a SolidColorBrush that is the color used to highlight a selected item that is inactive. |
![]() ![]() | InactiveSelectionHighlightBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of an inactive selected item. |
![]() ![]() | InactiveSelectionHighlightTextBrush | Gets a SolidColorBrush that is the color of an inactive selected item’s text. |
![]() ![]() | InactiveSelectionHighlightTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints a an inactive selected item’s text. |
![]() ![]() | InfoBrush | Gets a SolidColorBrush that is the background color for the ToolTip control. |
![]() ![]() | InfoBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of the ToolTip control. |
![]() ![]() | InfoColor | Gets a Color structure that is the background color for the ToolTip control. |
![]() ![]() | InfoColorKey | Gets the ResourceKey for the background Color of the ToolTip control. |
![]() ![]() | InfoTextBrush | Gets a SolidColorBrush that is the text color for the ToolTip control. |
![]() ![]() | InfoTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the text in a ToolTip control. |
![]() ![]() | InfoTextColor | Gets a Color structure that is the text color for the ToolTip control. |
![]() ![]() | InfoTextColorKey | Gets the ResourceKey for the Color of the text in a ToolTip control. |
![]() ![]() | MenuBarBrush | Gets a SolidColorBrush that is the background color for a menu bar. |
![]() ![]() | MenuBarBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of a menu bar. |
![]() ![]() | MenuBarColor | Gets a Color structure that is the background color for a menu bar. |
![]() ![]() | MenuBarColorKey | Gets the ResourceKey for the background Color of a menu bar. |
![]() ![]() | MenuBrush | Gets a SolidColorBrush that is the color of a menu's background. |
![]() ![]() | MenuBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of a menu. |
![]() ![]() | MenuColor | Gets a Color structure that is the color of a menu's background. |
![]() ![]() | MenuColorKey | Gets the ResourceKey for the background Color of a menu. |
![]() ![]() | MenuHighlightBrush | Gets a SolidColorBrush that is the color used to highlight a menu item. |
![]() ![]() | MenuHighlightBrushKey | Gets the ResourceKey for the SolidColorBrush that paints a highlighted menu item. |
![]() ![]() | MenuHighlightColor | Gets a Color structure that is the color used to highlight a menu item. |
![]() ![]() | MenuHighlightColorKey | Gets the ResourceKey for the background Color of a highlighted menu item. |
![]() ![]() | MenuTextBrush | Gets a SolidColorBrush that is the color of a menu's text. |
![]() ![]() | MenuTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints a menu's text. |
![]() ![]() | MenuTextColor | Gets a Color structure that is the color of a menu's text. |
![]() ![]() | MenuTextColorKey | Gets the ResourceKey for the Color of a menu's text. |
![]() ![]() | ScrollBarBrush | Gets a SolidColorBrush that is the background color of a scroll bar. |
![]() ![]() | ScrollBarBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of a scroll bar. |
![]() ![]() | ScrollBarColor | Gets a Color structure that is the background color of a scroll bar. |
![]() ![]() | ScrollBarColorKey | Gets the ResourceKey for the background Color of a scroll bar. |
![]() ![]() | WindowBrush | Gets a SolidColorBrush that is the background color in the client area of a window. |
![]() ![]() | WindowBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the background of a window's client area. |
![]() ![]() | WindowColor | Gets a Color structure that is the background color in the client area of a window. |
![]() ![]() | WindowColorKey | Gets the ResourceKey for the background Color of a window's client area. |
![]() ![]() | WindowFrameBrush | Gets a SolidColorBrush that is the color of a window frame. |
![]() ![]() | WindowFrameBrushKey | Gets the ResourceKey for the SolidColorBrush that paints a window frame. |
![]() ![]() | WindowFrameColor | Gets a Color structure that is the color of a window frame. |
![]() ![]() | WindowFrameColorKey | Gets the ResourceKey for the Color of a window frame. |
![]() ![]() | WindowTextBrush | Gets a SolidColorBrush that is the color of the text in the client area of a window. |
![]() ![]() | WindowTextBrushKey | Gets the ResourceKey for the SolidColorBrush that paints the text in the client area of a window. |
![]() ![]() | WindowTextColor | Gets a Color structure that is the color of the text in the client area of a window. |
![]() ![]() | WindowTextColorKey | Gets the ResourceKey for the Color of text in a window's client area. |
The SystemColors class provides access to system brushes and colors, such as ControlBrush, ControlBrushKey, and DesktopBrush. A system brush is a SolidColorBrush object that paints an area with the specified system color. A system brush always produces a solid fill; it can't be used to create a gradient.
You can use system brushes as either a static or a dynamic resource. Use a dynamic resource if you want the brush to update automatically if the user changes the system brush as the application is running; otherwise, use a static resource. The SystemColors class contains a variety of static properties that follow a strict naming convention:
<SystemColor>Brush
Gets a static reference to a SolidColorBrush of the specified system color.
<SystemColor>BrushKey
Gets a dynamic reference to a SolidColorBrush of the specified system color.
<SystemColor>Color
Gets a static reference to a Color structure of the specified system color.
<SystemColor>ColorKey
Gets a dynamic reference to the Color structure of the specified system color.
A system color is a Color structure that can be used to configure a brush. For example, you can create a gradient using system colors by setting the Color properties of a LinearGradientBrush object's gradient stops with system colors. For an example, see How to: Use System Colors in a Gradient.
The following example uses a dynamic system brush reference to set the Background of a button.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="SystemColors Example" Background="White"> <StackPanel Margin="20"> <!-- Uses a dynamic resource to set the background of a button. If the desktop brush changes while this application is running, this button will be updated. --> <Button Background="{DynamicResource {x:Static SystemColors.DesktopBrushKey}}" Content="Hello, World!" /> </StackPanel> </Page>
The next example uses a static system brush reference to set the Background of a button.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="SystemColors Example" Background="White"> <StackPanel Margin="20"> <!-- Uses a static brush to set the background of a button. If the desktop brush changes while this application is running, this button will not be updated until the page is loaded again. --> <Button Background="{x:Static SystemColors.DesktopBrush}" Content="Hello, World!" /> </StackPanel> </Page>
For an example showing how to use a system color in a gradient, see How to: Use System Colors in a Gradient.
More Code
| How to: Use System Colors in a Gradient | To use a system color in a gradient, you use the <SystemColor>Color and <SystemColor>ColorKey static properties of the SystemColors class to obtain a reference to the color, where <SystemColor> is the name of the desired system color. Use the <SystemColor>ColorKey properties when you want to create a dynamic reference that updates automatically as the system theme changes. Otherwise, use the <SystemColor>Color properties. |
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
