Udostępnij przez


SystemPens.WindowText Właściwość

Definicja

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

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

Wartość właściwości

Pen

Jest Pen to kolor tekstu w obszarze klienta okna.

Przykłady

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

private void DrawWithWindowTextPen(PaintEventArgs e)
{
    Rectangle rectangle1 = new Rectangle(10, 10, 100, 100);
    e.Graphics.DrawRectangle(SystemPens.WindowText, rectangle1);
}
    Private Sub DrawWithWindowTextPen(ByVal e As PaintEventArgs) 
        Dim rectangle1 As New Rectangle(10, 10, 100, 100)
        e.Graphics.DrawRectangle(SystemPens.WindowText, rectangle1)
    
    End Sub
End Class

Dotyczy