SystemColors 類別

定義

SystemColors 類別的每個屬性是 Color 結構,這個結構為 Windows 顯示項目的色彩。Each property of the SystemColors class is a Color structure that is the color of a Windows display element.

public ref class SystemColors sealed
public sealed class SystemColors
type SystemColors = class
Public NotInheritable Class SystemColors
繼承
SystemColors

範例

下列程式碼範例示範Equality運算子SystemColors和類別。The following code example demonstrates the Equality operator and the SystemColors class. 這個範例是設計來搭配包含名為Button1之按鈕的 Windows Form 使用。This example is designed to be used with a Windows Form that contains a button named Button1. 將下列程式碼貼到您的表單Button1_Click中, 並將方法Click與按鈕的事件產生關聯。Paste the following code into your form and associate the Button1_Click method with the button's Click event.

void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   if ( this->BackColor == SystemColors::ControlDark )
   {
      this->BackColor = SystemColors::Control;
   }
}
private void Button1_Click(System.Object sender, System.EventArgs e)
{

    if (this.BackColor == SystemColors.ControlDark)
    {
        this.BackColor = SystemColors.Control;
    }
}
Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click

    If (Color.op_Equality(Me.BackColor, SystemColors.ControlDark)) Then
        Me.BackColor = SystemColors.Control
    End If
End Sub

備註

藉由使用SystemPensSystemBrushes類別的屬性, 而不是根據中SystemColors的值建立新的畫筆或筆刷, 即可達到較佳的效能。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. 例如, 如果您想要取得3d 專案之臉部色彩的筆刷, 請使用SystemBrushes.Control屬性, 因為它會取得已存在的筆刷, 而SolidBrush呼叫具有參數值的SystemColors.Control函式將會建立新的筆刷。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.

屬性

ActiveBorder

取得 Color 結構,這是使用中視窗框線的色彩。Gets a Color structure that is the color of the active window's border.

ActiveCaption

取得 Color 結構,這個結構為使用中視窗標題列的背景色彩。Gets a Color structure that is the color of the background of the active window's title bar.

ActiveCaptionText

取得 Color 結構,這個結構為使用中視窗標題列的文字色彩。Gets a Color structure that is the color of the text in the active window's title bar.

AppWorkspace

取得 Color 結構,這個結構為應用程式工作區 (Workspace) 的色彩。Gets a Color structure that is the color of the application workspace.

ButtonFace

取得 Color 結構,這個結構為 3D 項目的表面色彩。Gets a Color structure that is the face color of a 3-D element.

ButtonHighlight

取得 Color 結構,這個結構為 3D 項目的反白色彩。Gets a Color structure that is the highlight color of a 3-D element.

ButtonShadow

取得 Color 結構,這個結構為 3D 項目的陰影色彩。Gets a Color structure that is the shadow color of a 3-D element.

Control

取得 Color 結構,這個結構為 3D 項目的表面色彩。Gets a Color structure that is the face color of a 3-D element.

ControlDark

取得 Color 結構,這個結構為 3D 項目的陰影色彩。Gets a Color structure that is the shadow color of a 3-D element.

ControlDarkDark

取得 Color 結構,這個結構為 3D 項目的深色陰影色彩。Gets a Color structure that is the dark shadow color of a 3-D element.

ControlLight

取得 Color 結構,這個結構為 3D 項目的淺色色彩。Gets a Color structure that is the light color of a 3-D element.

ControlLightLight

取得 Color 結構,這個結構為 3D 項目的反白色彩。Gets a Color structure that is the highlight color of a 3-D element.

ControlText

取得 Color 結構,這個結構為 3D 項目中的文字色彩。Gets a Color structure that is the color of text in a 3-D element.

Desktop

取得 Color 結構,這個結構為桌面的色彩。Gets a Color structure that is the color of the desktop.

GradientActiveCaption

取得 Color 結構,該結構為現用視窗標題列的色彩漸層中最亮的色彩。Gets a Color structure that is the lightest color in the color gradient of an active window's title bar.

GradientInactiveCaption

取得 Color 結構,該結構為非現用視窗標題列的色彩漸層中最亮的色彩。Gets a Color structure that is the lightest color in the color gradient of an inactive window's title bar.

GrayText

取得 Color 結構,這個結構為暗灰色 (Dimmed) 文字的色彩。Gets a Color structure that is the color of dimmed text.

Highlight

取得 Color 結構,這個結構為選取項目的背景色彩。Gets a Color structure that is the color of the background of selected items.

HighlightText

取得 Color 結構,也就是所選項目的文字色彩。Gets a Color structure that is the color of the text of selected items.

HotTrack

取得 Color 結構,這個結構是用來指定熱點追蹤項目的色彩。Gets a Color structure that is the color used to designate a hot-tracked item.

InactiveBorder

取得 Color 結構,這個結構為非使用中視窗框線的色彩。Gets a Color structure that is the color of an inactive window's border.

InactiveCaption

取得 Color 結構,這個結構為非使用中視窗標題列的背景色彩。Gets a Color structure that is the color of the background of an inactive window's title bar.

InactiveCaptionText

取得 Color 結構,這個結構為非使用中視窗標題列的文字色彩。Gets a Color structure that is the color of the text in an inactive window's title bar.

Info

取得 Color 結構,這個結構為工具提示的背景色彩。Gets a Color structure that is the color of the background of a ToolTip.

InfoText

取得 Color 結構,這個結構為工具提示的文字色彩。Gets a Color structure that is the color of the text of a ToolTip.

Menu

取得 Color 結構,這個結構為功能表背景的色彩。Gets a Color structure that is the color of a menu's background.

MenuBar

取得 Color 結構,該結構為功能表列的背景色彩。Gets a Color structure that is the color of the background of a menu bar.

MenuHighlight

取得 Color 結構,該結構為用來在功能表顯示為平面功能表時反白顯示功能表項目的色彩。Gets a Color structure that is the color used to highlight menu items when the menu appears as a flat menu.

MenuText

取得 Color 結構,這個結構為功能表文字的色彩。Gets a Color structure that is the color of a menu's text.

ScrollBar

取得 Color 結構,這個結構為捲軸的背景色彩。Gets a Color structure that is the color of the background of a scroll bar.

Window

取得 Color 結構,這個結構為視窗工作區 (Client Area) 中背景的色彩。Gets a Color structure that is the color of the background in the client area of a window.

WindowFrame

取得 Color 結構,這個結構為視窗框架 (Frame) 的色彩。Gets a Color structure that is the color of a window frame.

WindowText

取得 Color 結構,這個結構為視窗工作區中文字的色彩。Gets a Color structure that is the color of the text in the client area of a window.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於