SystemPens 클래스

정의

SystemPens 클래스의 각 속성은 Windows 표시 요소의 색인 1픽셀 너비의 Pen입니다.

public ref class SystemPens abstract sealed
public ref class SystemPens sealed
public static class SystemPens
public sealed class SystemPens
type SystemPens = class
Public Class SystemPens
Public NotInheritable Class SystemPens
상속
SystemPens

예제

다음 코드 예제에서는 이러한 형식에 대해 정의된 여러 오버로드된 연산자를 사용하여 점과 크기를 만듭니다. 또한 클래스를 사용하는 SystemPens 방법을 보여 줍니다.

이 예제는 Windows Forms 함께 사용하도록 설계되었습니다. 명명subtractButton된 폼을 만듭니다Button. 폼에 코드를 붙여넣고 양식의 Paint 이벤트 처리 메서드에서 메서드를 호출 CreatePointsAndSizes 하여 다음으로 PaintEventArgs전달 e 합니다.

void CreatePointsAndSizes( PaintEventArgs^ e )
{
   // Create the starting point.
   Point startPoint = Point(subtractButton->Size);
   
   // Use the addition operator to get the end point.
   Point endPoint = startPoint + System::Drawing::Size( 140, 150 );
   
   // Draw a line between the points.
   e->Graphics->DrawLine( SystemPens::Highlight, startPoint, endPoint );
   
   // Convert the starting point to a size and compare it to the
   // subtractButton size.  
   System::Drawing::Size buttonSize = (System::Drawing::Size)startPoint;
   if ( buttonSize == subtractButton->Size )
   {
      e->Graphics->DrawString( "The sizes are equal.", gcnew System::Drawing::Font( this->Font,FontStyle::Italic ), Brushes::Indigo, 10.0F, 65.0F );
   }
}
private void CreatePointsAndSizes(PaintEventArgs e)
{

    // Create the starting point.
    Point startPoint = new Point(subtractButton.Size);

    // Use the addition operator to get the end point.
    Point endPoint = startPoint + new Size(140, 150);

    // Draw a line between the points.
    e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint);

    // Convert the starting point to a size and compare it to the
    // subtractButton size.  
    Size buttonSize = (Size)startPoint;
    if (buttonSize == subtractButton.Size)

        // If the sizes are equal, tell the user.
    {
        e.Graphics.DrawString("The sizes are equal.", 
            new Font(this.Font, FontStyle.Italic), 
            Brushes.Indigo, 10.0F, 65.0F);
    }
}
Private Sub CreatePointsAndSizes(ByVal e As PaintEventArgs)

    ' Create the starting point.
    Dim startPoint As New Point(subtractButton.Size)

    ' Use the addition operator to get the end point.
    Dim endPoint As Point = Point.op_Addition(startPoint, _
        New Size(140, 150))

    ' Draw a line between the points.
    e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)

    ' Convert the starting point to a size and compare it to the
    ' subtractButton size.  
    Dim buttonSize As Size = Point.op_Explicit(startPoint)
    If (Size.op_Equality(buttonSize, subtractButton.Size)) Then

        ' If the sizes are equal, tell the user.
        e.Graphics.DrawString("The sizes are equal.", _
            New Font(Me.Font, FontStyle.Italic), _
            Brushes.Indigo, 10.0F, 65.0F)
    End If

End Sub

설명

참고

.NET 6 이상 버전에서 이 형식을 포함하는 System.Drawing.Common 패키지는Windows 운영 체제에서만 지원됩니다. 플랫폼 간 앱에서 이 형식을 사용하면 컴파일 시간 경고 및 런타임 예외가 발생합니다. 자세한 내용은 Windows 에서만 지원되는 System.Drawing.Common을 참조하세요.

속성

ActiveBorder

활성 창의 테두리 색인 Pen을 가져옵니다.

ActiveCaption

활성 창 제목 표시줄의 배경색인 Pen를 가져옵니다.

ActiveCaptionText

활성 창의 제목 표시줄에 있는 텍스트의 색인 Pen를 가져옵니다.

AppWorkspace

애플리케이션 작업 공간의 색인 Pen를 가져옵니다.

ButtonFace

3차원 요소의 표면 색인 Pen을 가져옵니다.

ButtonHighlight

3차원 요소의 강조 색인 Pen을 가져옵니다.

ButtonShadow

3차원 요소의 그림자 색인 Pen을 가져옵니다.

Control

3차원 요소의 표면 색인 Pen을 가져옵니다.

ControlDark

3차원 요소의 그림자 색인 Pen을 가져옵니다.

ControlDarkDark

3차원 요소의 짙은 그림자 색인 Pen을 가져옵니다.

ControlLight

3차원 요소의 옅은 색인 Pen을 가져옵니다.

ControlLightLight

3차원 요소의 강조 색인 Pen을 가져옵니다.

ControlText

3차원 요소의 텍스트 색인 Pen을 가져옵니다.

Desktop

Windows 바탕 화면의 색인 Pen을 가져옵니다.

GradientActiveCaption

활성 창 제목 표시줄의 색 그라데이션에서 가장 옅은 색인 Pen을 가져옵니다.

GradientInactiveCaption

비활성 창 제목 표시줄의 색 그라데이션에서 가장 옅은 색인 Pen을 가져옵니다.

GrayText

흐리게 표시되는 텍스트 색인 Pen을 가져옵니다.

Highlight

선택한 항목의 배경색인 Pen을 가져옵니다.

HighlightText

선택된 항목의 텍스트 색인 Pen를 가져옵니다.

HotTrack

핫 트랙 항목을 지정하는 데 사용하는 색인 Pen를 가져옵니다.

InactiveBorder

비활성 창의 테두리 색인 Pen을 가져옵니다.

InactiveCaption

비활성 창의 제목 표시줄 캡션 색인 Pen을 가져옵니다.

InactiveCaptionText

비활성 창 제목 표시줄의 텍스트 색인 Pen을 가져옵니다.

Info

도구 설명의 배경색인 Pen을 가져옵니다.

InfoText

도구 설명의 텍스트 색인 Pen을 가져옵니다.

Menu

메뉴의 배경색인 Pen을 가져옵니다.

MenuBar

메뉴 모음의 배경색인 Pen을 가져옵니다.

MenuHighlight

메뉴가 기본 메뉴로 표시될 때 메뉴 항목을 강조 표시하는 데 사용되는 색인 Pen을 가져옵니다.

MenuText

메뉴의 텍스트 색인 Pen을 가져옵니다.

ScrollBar

스크롤 막대의 배경색인 Pen을 가져옵니다.

Window

창의 클라이언트 영역 배경색인 Pen을 가져옵니다.

WindowFrame

창 프레임의 색인 Pen을 가져옵니다.

WindowText

창의 클라이언트 영역에 있는 텍스트 색인 Pen을 가져옵니다.

메서드

FromSystemColor(Color)

지정된 Pen에서 Color을 만듭니다.

적용 대상