SystemBrushes 類別

定義

SystemBrushes 類別的每個屬性是 SolidBrush,其為 Windows 顯示項目的色彩。Each property of the SystemBrushes class is a SolidBrush that is the color of a Windows display element.

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

範例

下列程式碼範例顯示如何使用HotkeyPrefix屬性來設定鍵盤快速鍵。The following code example shows how to set a keyboard shortcut using the HotkeyPrefix property. 它也會示範如何使用FromSystemColor方法。It also demonstrates how to use the FromSystemColor method. 若要執行此範例, 請將程式碼貼入表單中、處理Paint表單的事件, 並呼叫下列e方法PaintEventArgs, 傳遞為。To run this example, paste the code into a form, handle the form's Paint event and call the following method, passing e as PaintEventArgs.

private:
   void ShowHotKey( PaintEventArgs^ e )
   {
      // Declare the string with a keyboard shortcut.
      String^ text = "&Click Here";

      // Declare a new StringFormat.
      StringFormat^ format = gcnew StringFormat;

      // Set the HotkeyPrefix property.
      format->HotkeyPrefix = System::Drawing::Text::HotkeyPrefix::Show;

      // Draw the string.
      Brush^ theBrush = SystemBrushes::FromSystemColor( SystemColors::Highlight );
      e->Graphics->DrawString( text, this->Font, theBrush, 30, 40, format );
   }
private void ShowHotKey(PaintEventArgs e)
{

    // Declare the string with a keyboard shortcut.
    string text = "&Click Here";

    // Declare a new StringFormat.
    StringFormat format = new StringFormat();

    // Set the HotkeyPrefix property.
    format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;

    // Draw the string.
    Brush theBrush = 
        SystemBrushes.FromSystemColor(SystemColors.Highlight);

    e.Graphics.DrawString(text, this.Font, theBrush, 30, 40, format);
}
Private Sub ShowHotKey(ByVal e As PaintEventArgs)

    ' Declare the string with keyboard shortcut.
    Dim text As String = "&Click Here"

    ' Declare a new StringFormat.
    Dim format As New StringFormat

    ' Set the HotkeyPrefix property.
    format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show

    ' Draw the string.
    Dim theBrush As Brush = _
        SystemBrushes.FromSystemColor(SystemColors.Highlight)
    e.Graphics.DrawString(text, Me.Font, theBrush, 30, 40, format)
End Sub

屬性

ActiveBorder

取得 SolidBrush,其為使用中視窗框線的色彩。Gets a SolidBrush that is the color of the active window's border.

ActiveCaption

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

ActiveCaptionText

取得 SolidBrush,這是使用中視窗標題列之文字的色彩。Gets a SolidBrush that is the color of the text in the active window's title bar.

AppWorkspace

取得 SolidBrush,這是應用程式工作區的色彩。Gets a SolidBrush that is the color of the application workspace.

ButtonFace

取得 SolidBrush,其為 3D 項目的表面色彩。Gets a SolidBrush that is the face color of a 3-D element.

ButtonHighlight

取得 SolidBrush,其為 3D 項目的醒目提示色彩。Gets a SolidBrush that is the highlight color of a 3-D element.

ButtonShadow

取得 SolidBrush,其為 3D 項目的陰影色彩。Gets a SolidBrush that is the shadow color of a 3-D element.

Control

取得 SolidBrush,其為 3D 項目的表面色彩。Gets a SolidBrush that is the face color of a 3-D element.

ControlDark

取得 SolidBrush,其為 3D 項目的陰影色彩。Gets a SolidBrush that is the shadow color of a 3-D element.

ControlDarkDark

取得 SolidBrush,其為 3D 項目的深色陰影色彩。Gets a SolidBrush that is the dark shadow color of a 3-D element.

ControlLight

取得 SolidBrush,其為 3D 項目的淺色色彩。Gets a SolidBrush that is the light color of a 3-D element.

ControlLightLight

取得 SolidBrush,其為 3D 項目的醒目提示色彩。Gets a SolidBrush that is the highlight color of a 3-D element.

ControlText

取得 SolidBrush,其為 3D 項目中文字的色彩。Gets a SolidBrush that is the color of text in a 3-D element.

Desktop

取得 SolidBrush,其為桌面的色彩。Gets a SolidBrush that is the color of the desktop.

GradientActiveCaption

取得 SolidBrush,其為使用中視窗標題列之色彩漸層中最亮的色彩。Gets a SolidBrush that is the lightest color in the color gradient of an active window's title bar.

GradientInactiveCaption

取得 SolidBrush,其為非使用中視窗標題列之色彩漸層中最亮的色彩。Gets a SolidBrush that is the lightest color in the color gradient of an inactive window's title bar.

GrayText

取得 SolidBrush,其為暗灰色文字的色彩。Gets a SolidBrush that is the color of dimmed text.

Highlight

取得 SolidBrush,其為選取之項目的背景色彩。Gets a SolidBrush that is the color of the background of selected items.

HighlightText

取得 SolidBrush,其為選取之項目的文字色彩。Gets a SolidBrush that is the color of the text of selected items.

HotTrack

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

InactiveBorder

取得 SolidBrush,其為非使用中視窗框線的色彩。Gets a SolidBrush that is the color of an inactive window's border.

InactiveCaption

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

InactiveCaptionText

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

Info

取得 SolidBrush,其為工具提示的背景色彩。Gets a SolidBrush that is the color of the background of a ToolTip.

InfoText

取得 SolidBrush,其為工具提示的文字色彩。Gets a SolidBrush that is the color of the text of a ToolTip.

Menu

取得 SolidBrush,其為功能表的背景色彩。Gets a SolidBrush that is the color of a menu's background.

MenuBar

取得 SolidBrush,其為功能表列的背景色彩。Gets a SolidBrush that is the color of the background of a menu bar.

MenuHighlight

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

MenuText

取得 SolidBrush,其為功能表文字的色彩。Gets a SolidBrush that is the color of a menu's text.

ScrollBar

取得 SolidBrush,其為捲軸的背景色彩。Gets a SolidBrush that is the color of the background of a scroll bar.

Window

取得 SolidBrush,其為視窗工作區中背景的色彩。Gets a SolidBrush that is the color of the background in the client area of a window.

WindowFrame

取得 SolidBrush,其為視窗框架的色彩。Gets a SolidBrush that is the color of a window frame.

WindowText

取得 SolidBrush,其為視窗工作區中 (client area) 文字的色彩。Gets a SolidBrush 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)
FromSystemColor(Color)

從指定的 Brush 結構建立 ColorCreates a Brush from the specified Color structure.

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)

適用於