SystemPens.WindowText プロパティ

定義

ウィンドウのクライアント領域のテキストの色を表す Pen を取得します。

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

プロパティ値

Pen

ウィンドウのクライアント領域のテキストの色を表す Pen

次のコード例では、 プロパティの使用方法を WindowText 示します。 この例を実行するには、Windows フォームに貼り付けます。 フォームのPaintイベントを処理し、イベント処理メソッドから メソッドをPaint呼び出しDrawWithWindowText、 を としてPaintEventArgs渡しますe

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

適用対象