SystemBrushes SystemBrushes SystemBrushes SystemBrushes Class

Definition

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
Inheritance
SystemBrushesSystemBrushesSystemBrushesSystemBrushes

Examples

The following code example shows how to set a keyboard shortcut using the HotkeyPrefix property. It also demonstrates how to use the FromSystemColor method. 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

Properties

ActiveBorder ActiveBorder ActiveBorder ActiveBorder

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

ActiveCaption ActiveCaption ActiveCaption ActiveCaption

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

ActiveCaptionText ActiveCaptionText ActiveCaptionText ActiveCaptionText

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

AppWorkspace AppWorkspace AppWorkspace AppWorkspace

Gets a SolidBrush that is the color of the application workspace.

ButtonFace ButtonFace ButtonFace ButtonFace

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

ButtonHighlight ButtonHighlight ButtonHighlight ButtonHighlight

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

ButtonShadow ButtonShadow ButtonShadow ButtonShadow

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

Control Control Control Control

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

ControlDark ControlDark ControlDark ControlDark

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

ControlDarkDark ControlDarkDark ControlDarkDark ControlDarkDark

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

ControlLight ControlLight ControlLight ControlLight

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

ControlLightLight ControlLightLight ControlLightLight ControlLightLight

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

ControlText ControlText ControlText ControlText

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

Desktop Desktop Desktop Desktop

Gets a SolidBrush that is the color of the desktop.

GradientActiveCaption GradientActiveCaption GradientActiveCaption GradientActiveCaption

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

GradientInactiveCaption GradientInactiveCaption GradientInactiveCaption GradientInactiveCaption

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

GrayText GrayText GrayText GrayText

Gets a SolidBrush that is the color of dimmed text.

Highlight Highlight Highlight Highlight

Gets a SolidBrush that is the color of the background of selected items.

HighlightText HighlightText HighlightText HighlightText

Gets a SolidBrush that is the color of the text of selected items.

HotTrack HotTrack HotTrack HotTrack

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

InactiveBorder InactiveBorder InactiveBorder InactiveBorder

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

InactiveCaption InactiveCaption InactiveCaption InactiveCaption

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

InactiveCaptionText InactiveCaptionText InactiveCaptionText InactiveCaptionText

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

Info Info Info Info

Gets a SolidBrush that is the color of the background of a ToolTip.

InfoText InfoText InfoText InfoText

Gets a SolidBrush that is the color of the text of a ToolTip.

Menu Menu Menu Menu

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

MenuBar MenuBar MenuBar MenuBar

Gets a SolidBrush that is the color of the background of a menu bar.

MenuHighlight MenuHighlight MenuHighlight MenuHighlight

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

MenuText MenuText MenuText MenuText

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

ScrollBar ScrollBar ScrollBar ScrollBar

Gets a SolidBrush that is the color of the background of a scroll bar.

Window Window Window Window

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

WindowFrame WindowFrame WindowFrame WindowFrame

Gets a SolidBrush that is the color of a window frame.

WindowText WindowText WindowText WindowText

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

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FromSystemColor(Color) FromSystemColor(Color) FromSystemColor(Color) FromSystemColor(Color)

Creates a Brush from the specified Color structure.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to