Aracılığıyla paylaş


SystemPens.Desktop Özellik

Tanım

Windows masaüstünün rengi olan bir Pen alır.

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

Özellik Değeri

Pen

Pen Windows masaüstünün rengi olan bir.

Örnekler

Aşağıdaki kod örneği özelliğinin Desktop nasıl kullanılacağını gösterir. Bu örneği çalıştırmak için windows formuna yapıştırın. Formun Paint olayını işleyip olarak geçirerek olay işleme yönteminden Paint yöntemini çağırın eDrawWithControlDesktopPenPaintEventArgs.

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

End Sub

Şunlara uygulanır