SystemPens.MenuText Właściwość

Definicja

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

public:
 static property System::Drawing::Pen ^ MenuText { System::Drawing::Pen ^ get(); };
public static System.Drawing.Pen MenuText { get; }
static member MenuText : System.Drawing.Pen
Public Shared ReadOnly Property MenuText As Pen

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);
}
Private Sub DrawWithMenuTextPen(ByVal e As PaintEventArgs) 
    Dim rectangle1 As New Rectangle(10, 10, 100, 100)
    e.Graphics.DrawRectangle(SystemPens.MenuText, rectangle1)

End Sub

Dotyczy