SystemBrushes Klasa

Definicja

Każda właściwość SystemBrushes klasy jest SolidBrush kolorem elementu wyświetlania systemu Windows.

public ref class SystemBrushes abstract sealed
public ref class SystemBrushes sealed
public static class SystemBrushes
public sealed class SystemBrushes
type SystemBrushes = class
Public Class SystemBrushes
Public NotInheritable Class SystemBrushes
Dziedziczenie
SystemBrushes

Przykłady

Poniższy przykład kodu pokazuje, jak ustawić skrót klawiaturowy przy użyciu HotkeyPrefix właściwości . Pokazuje również, jak używać FromSystemColor metody . Aby uruchomić ten przykład, wklej kod do formularza, obsłuż zdarzenie formularza Paint i wywołaj następującą metodę, przekazując e jako 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

Uwagi

Uwaga

W programie .NET 6 i nowszych wersjach pakiet System.Drawing.Common, który obejmuje ten typ, jest obsługiwany tylko w systemach operacyjnych Windows. Użycie tego typu w aplikacjach międzyplatformowych powoduje ostrzeżenia w czasie kompilacji i wyjątki czasu wykonywania. Aby uzyskać więcej informacji, zobacz System.Drawing.Common only supported on Windows (Obsługiwane tylko w systemie Windows).

Właściwości

ActiveBorder

Pobiera wartość SolidBrush , która jest kolorem obramowania aktywnego okna.

ActiveCaption

Pobiera wartość , SolidBrush która jest kolorem tła paska tytułu aktywnego okna.

ActiveCaptionText

SolidBrush Pobiera kolor tekstu na pasku tytułu aktywnego okna.

AppWorkspace

Pobiera kolor SolidBrush obszaru roboczego aplikacji.

ButtonFace

Pobiera wartość , SolidBrush która jest kolorem twarzy elementu 3-W.

ButtonHighlight

Pobiera element SolidBrush , który jest kolorem wyróżnienia elementu 3-W.

ButtonShadow

Pobiera wartość , SolidBrush która jest kolorem cienia elementu 3-W.

Control

Pobiera wartość , SolidBrush która jest kolorem twarzy elementu 3-W.

ControlDark

Pobiera wartość , SolidBrush która jest kolorem cienia elementu 3-W.

ControlDarkDark

Pobiera element SolidBrush , który jest ciemnym kolorem cienia elementu 3-W.

ControlLight

Pobiera element SolidBrush , który jest jasnym kolorem elementu 3-W.

ControlLightLight

Pobiera element SolidBrush , który jest kolorem wyróżnienia elementu 3-W.

ControlText

SolidBrush Pobiera element , który jest kolorem tekstu w elemecie 3-W.

Desktop

Pobiera element SolidBrush , który jest kolorem pulpitu.

GradientActiveCaption

SolidBrush Pobiera najjaśniejszy kolor gradientu kolorów paska tytułu aktywnego okna.

GradientInactiveCaption

SolidBrush Pobiera najjaśniejszy kolor gradientu kolorów paska tytułu nieaktywnego okna.

GrayText

Pobiera kolor SolidBrush wygaszonego tekstu.

Highlight

Pobiera element SolidBrush , który jest kolorem tła zaznaczonych elementów.

HighlightText

SolidBrush Pobiera element , który jest kolorem tekstu zaznaczonych elementów.

HotTrack

Pobiera element SolidBrush , który jest kolorem używanym do wyznaczania elementu śledzonego na gorąco.

InactiveBorder

SolidBrush Pobiera kolor obramowania nieaktywnego okna.

InactiveCaption

SolidBrush Pobiera kolor tła paska tytułu nieaktywnego okna.

InactiveCaptionText

SolidBrush Pobiera kolor tekstu na pasku tytułu nieaktywnego okna.

Info

Pobiera wartość , SolidBrush która jest kolorem tła etykietki narzędzia.

InfoText

SolidBrush Pobiera wartość , która jest kolorem tekstu etykietki narzędzia.

Menu

Pobiera element SolidBrush , który jest kolorem tła menu.

MenuBar

Pobiera wartość SolidBrush , która jest kolorem tła paska menu.

MenuHighlight

SolidBrush Pobiera kolor używany do wyróżniania elementów menu, gdy menu jest wyświetlane jako menu płaskie.

MenuText

SolidBrush Pobiera element , który jest kolorem tekstu menu.

ScrollBar

SolidBrush Pobiera wartość , która jest kolorem tła paska przewijania.

Window

SolidBrush Pobiera wartość , która jest kolorem tła w obszarze klienta okna.

WindowFrame

Pobiera element SolidBrush , który jest kolorem ramki okna.

WindowText

SolidBrush Pobiera wartość , która jest kolorem tekstu w obszarze klienta okna.

Metody

FromSystemColor(Color)

Tworzy obiekt Brush na podstawie określonej Color struktury.

Dotyczy