ControlPaint.DrawBorder 메서드

정의

단추 스타일의 컨트롤에 테두리를 그립니다.

오버로드

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

지정된 그래픽 표면의 지정된 범위 내에 지정된 스타일 및 색으로 단추 스타일 컨트롤의 테두리를 그립니다.

DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle)

지정된 그래픽 표면의 지정된 범위 내에 지정된 스타일, 색 및 테두리 너비를 사용하여 단추 스타일 컨트롤의 테두리를 그립니다.

DrawBorder(Graphics, Rectangle, Color, ButtonBorderStyle)

지정된 그래픽 표면의 지정된 범위 내에 지정된 스타일 및 색으로 단추 스타일 컨트롤의 테두리를 그립니다.

public:
 static void DrawBorder(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle bounds, System::Drawing::Color color, System::Windows::Forms::ButtonBorderStyle style);
public static void DrawBorder (System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Drawing.Color color, System.Windows.Forms.ButtonBorderStyle style);
static member DrawBorder : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * System.Windows.Forms.ButtonBorderStyle -> unit
Public Shared Sub DrawBorder (graphics As Graphics, bounds As Rectangle, color As Color, style As ButtonBorderStyle)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

bounds
Rectangle

테두리의 크기를 나타내는 Rectangle입니다.

color
Color

테두리의 Color입니다.

style
ButtonBorderStyle

테두리 스타일을 지정하는 ButtonBorderStyle 값 중 하나입니다.

예제

다음 코드 예제에서는 메서드 중 하나를 사용하는 방법을 보여 줍니다 DrawBorder3D . 이 예제를 실행하려면 및 System.Drawing 네임스페이스를 System.Windows.Forms 가져오는 양식에 다음 코드를 붙여넣습니다. 양식의 이벤트가 이 예제의 Paint 이벤트 처리기와 연결되어 있는지 확인합니다.

// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
void Form1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   Rectangle borderRectangle = this->ClientRectangle;
   borderRectangle.Inflate(  -10, -10 );
   ControlPaint::DrawBorder3D( e->Graphics, borderRectangle, Border3DStyle::Raised );
}
// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
private void Form1_Paint(object sender, PaintEventArgs e)
{

    Rectangle borderRectangle = this.ClientRectangle;
    borderRectangle.Inflate(-10, -10);
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, 
        Border3DStyle.Raised);
}
' Handle the Form's Paint event to draw a 3D three-dimensional 
' raised border just inside the border of the frame.
Private Sub Form1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles MyBase.Paint

    Dim borderRectangle As Rectangle = Me.ClientRectangle
    borderRectangle.Inflate(-10, -10)
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, _
        Border3DStyle.Raised)
End Sub

적용 대상

DrawBorder(Graphics, Rectangle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle, Color, Int32, ButtonBorderStyle)

지정된 그래픽 표면의 지정된 범위 내에 지정된 스타일, 색 및 테두리 너비를 사용하여 단추 스타일 컨트롤의 테두리를 그립니다.

public:
 static void DrawBorder(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle bounds, System::Drawing::Color leftColor, int leftWidth, System::Windows::Forms::ButtonBorderStyle leftStyle, System::Drawing::Color topColor, int topWidth, System::Windows::Forms::ButtonBorderStyle topStyle, System::Drawing::Color rightColor, int rightWidth, System::Windows::Forms::ButtonBorderStyle rightStyle, System::Drawing::Color bottomColor, int bottomWidth, System::Windows::Forms::ButtonBorderStyle bottomStyle);
public static void DrawBorder (System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Drawing.Color leftColor, int leftWidth, System.Windows.Forms.ButtonBorderStyle leftStyle, System.Drawing.Color topColor, int topWidth, System.Windows.Forms.ButtonBorderStyle topStyle, System.Drawing.Color rightColor, int rightWidth, System.Windows.Forms.ButtonBorderStyle rightStyle, System.Drawing.Color bottomColor, int bottomWidth, System.Windows.Forms.ButtonBorderStyle bottomStyle);
static member DrawBorder : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle * System.Drawing.Color * int * System.Windows.Forms.ButtonBorderStyle -> unit
Public Shared Sub DrawBorder (graphics As Graphics, bounds As Rectangle, leftColor As Color, leftWidth As Integer, leftStyle As ButtonBorderStyle, topColor As Color, topWidth As Integer, topStyle As ButtonBorderStyle, rightColor As Color, rightWidth As Integer, rightStyle As ButtonBorderStyle, bottomColor As Color, bottomWidth As Integer, bottomStyle As ButtonBorderStyle)

매개 변수

graphics
Graphics

그릴 Graphics입니다.

bounds
Rectangle

테두리의 크기를 나타내는 Rectangle입니다.

leftColor
Color

테두리 왼쪽의 Color입니다.

leftWidth
Int32

왼쪽 테두리의 너비입니다.

leftStyle
ButtonBorderStyle

왼쪽 테두리 스타일을 지정하는 ButtonBorderStyle 값 중 하나입니다.

topColor
Color

테두리 위쪽의 Color입니다.

topWidth
Int32

위쪽 테두리의 너비입니다.

topStyle
ButtonBorderStyle

위쪽 테두리 스타일을 지정하는 ButtonBorderStyle 값 중 하나입니다.

rightColor
Color

테두리 오른쪽의 Color입니다.

rightWidth
Int32

오른쪽 테두리의 너비입니다.

rightStyle
ButtonBorderStyle

오른쪽 테두리 스타일을 지정하는 ButtonBorderStyle 값 중 하나입니다.

bottomColor
Color

테두리 아래쪽의 Color입니다.

bottomWidth
Int32

아래쪽 테두리의 너비입니다.

bottomStyle
ButtonBorderStyle

아래쪽 테두리 스타일을 지정하는 ButtonBorderStyle 값 중 하나입니다.

예제

다음 코드 예제에서는 메서드 중 하나를 사용하는 방법을 보여 줍니다 DrawBorder3D . 이 예제를 실행하려면 및 System.Drawing 네임스페이스를 System.Windows.Forms 가져오는 양식에 다음 코드를 붙여넣습니다. 양식의 이벤트가 이 예제의 Paint 이벤트 처리기와 연결되어 있는지 확인합니다.

// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
void Form1_Paint( Object^ /*sender*/, PaintEventArgs^ e )
{
   Rectangle borderRectangle = this->ClientRectangle;
   borderRectangle.Inflate(  -10, -10 );
   ControlPaint::DrawBorder3D( e->Graphics, borderRectangle, Border3DStyle::Raised );
}
// Handle the Form's Paint event to draw a 3D three-dimensional 
// raised border just inside the border of the frame.
private void Form1_Paint(object sender, PaintEventArgs e)
{

    Rectangle borderRectangle = this.ClientRectangle;
    borderRectangle.Inflate(-10, -10);
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, 
        Border3DStyle.Raised);
}
' Handle the Form's Paint event to draw a 3D three-dimensional 
' raised border just inside the border of the frame.
Private Sub Form1_Paint(ByVal sender As Object, _
    ByVal e As PaintEventArgs) Handles MyBase.Paint

    Dim borderRectangle As Rectangle = Me.ClientRectangle
    borderRectangle.Inflate(-10, -10)
    ControlPaint.DrawBorder3D(e.Graphics, borderRectangle, _
        Border3DStyle.Raised)
End Sub

추가 정보

적용 대상