SystemPens.ControlText Właściwość

Definicja

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

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

Wartość właściwości

Pen

Jest Pen to kolor tekstu w elemecie 3-W.

Przykłady

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

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

End Sub

Dotyczy