语言

SystemPens.ActiveCaption 属性

定义

获取一个 Pen 是活动窗口标题栏背景的颜色。

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

属性值

Pen

一种 Pen 是活动窗口标题栏背景的颜色。

示例

下面的代码示例演示如何使用该 ActiveCaption 属性。 若要运行此示例,请将其粘贴到 Windows 窗体中。 处理表单 Paint 的事件,并从事件处理方法调用 DrawWithActiveCaptionPen 该方法 Paint ,并传递 e 为 PaintEventArgs。

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

End Sub

适用于