SystemPens.AppWorkspace 属性

定义

获取表示应用程序工作区的颜色的 PenGets a Pen that is the color of the application workspace.

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

属性值

Pen

一个 Pen,它是应用程序工作区的颜色。A Pen that is the color of the application workspace.

示例

下面的代码示例演示如何使用 AppWorkspace 属性。The following code example demonstrates how to use the AppWorkspace property. 若要运行此示例,请将其粘贴到 Windows 窗体中。To run this example, paste it into a Windows Form. 处理窗体的 Paint 事件,并 DrawWithActiveAppWorkspacePenPaint 事件处理方法调用方法,并将 e 作为传递 PaintEventArgsHandle the form's Paint event and call the DrawWithActiveAppWorkspacePen method from the Paint event-handling method, passing e as 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

注解

"应用程序" 工作区是多个文档视图中未由文档占用的区域。The application workspace is the area in a multiple document view that is not being occupied by documents.

适用于