SystemPens.MenuText Właściwość

Definicja

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

public static System.Drawing.Pen MenuText { get; }

Wartość właściwości

Pen

Jest Pen to kolor tekstu menu.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać MenuText właściwości . Aby uruchomić ten przykład, wklej go do formularza systemu Windows. Obsłuż zdarzenie formularza Paint i wywołaj metodę DrawWithMenuTextPen z Paint metody obsługi zdarzeń, przekazując e jako PaintEventArgs.

private void DrawWithMenuTextPen(PaintEventArgs e)
{
    Rectangle rectangle1 = new Rectangle(10, 10, 100, 100);
    e.Graphics.DrawRectangle(SystemPens.MenuText, rectangle1);
}

Dotyczy

Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9