ControlPaint.DrawBorder3D ControlPaint.DrawBorder3D ControlPaint.DrawBorder3D Method

定义

在控件上绘制三维样式边框。Draws a three-dimensional style border on a control.

重载

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface and side, and within the specified bounds on a control.

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface and sides, and within the specified bounds on a control.

DrawBorder3D(Graphics, Rectangle, Border3DStyle) DrawBorder3D(Graphics, Rectangle, Border3DStyle) DrawBorder3D(Graphics, Rectangle, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

DrawBorder3D(Graphics, Rectangle) DrawBorder3D(Graphics, Rectangle) DrawBorder3D(Graphics, Rectangle)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface and side, and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::Border3DStyle style, System::Windows::Forms::Border3DSide sides);
public static void DrawBorder3D (System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.Border3DStyle style, System.Windows.Forms.Border3DSide sides);
static member DrawBorder3D : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.Border3DStyle * System.Windows.Forms.Border3DSide -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

x
Int32 Int32 Int32

矩形边框左上角的 x 坐标。The x-coordinate of the top left of the border rectangle.

y
Int32 Int32 Int32

矩形边框左上角的 y 坐标。The y-coordinate of the top left of the border rectangle.

width
Int32 Int32 Int32

矩形边框的宽度。The width of the border rectangle.

height
Int32 Int32 Int32

矩形边框的高度。The height of the border rectangle.

style
Border3DStyle Border3DStyle Border3DStyle

Border3DStyle 值之一,它指定边框的样式。One of the Border3DStyle values that specifies the style of the border.

sides
Border3DSide Border3DSide Border3DSide

在其上绘制边框的矩形的 Border3DSideThe Border3DSide of the rectangle to draw the border on.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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
另请参阅

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height, System::Windows::Forms::Border3DStyle style);
public static void DrawBorder3D (System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.Border3DStyle style);
static member DrawBorder3D : System.Drawing.Graphics * int * int * int * int * System.Windows.Forms.Border3DStyle -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

x
Int32 Int32 Int32

矩形边框左上角的 x 坐标。The x-coordinate of the top left of the border rectangle.

y
Int32 Int32 Int32

矩形边框左上角的 y 坐标。The y-coordinate of the top left of the border rectangle.

width
Int32 Int32 Int32

矩形边框的宽度。The width of the border rectangle.

height
Int32 Int32 Int32

矩形边框的高度。The height of the border rectangle.

style
Border3DStyle Border3DStyle Border3DStyle

Border3DStyle 值之一,它指定边框的样式。One of the Border3DStyle values that specifies the style of the border.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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
另请参阅

DrawBorder3D(Graphics, Int32, Int32, Int32, Int32) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32) DrawBorder3D(Graphics, Int32, Int32, Int32, Int32)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, int x, int y, int width, int height);
public static void DrawBorder3D (System.Drawing.Graphics graphics, int x, int y, int width, int height);
static member DrawBorder3D : System.Drawing.Graphics * int * int * int * int -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

x
Int32 Int32 Int32

矩形边框左上角的 x 坐标。The x-coordinate of the top left of the border rectangle.

y
Int32 Int32 Int32

矩形边框左上角的 y 坐标。The y-coordinate of the top left of the border rectangle.

width
Int32 Int32 Int32

矩形边框的宽度。The width of the border rectangle.

height
Int32 Int32 Int32

矩形边框的高度。The height of the border rectangle.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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

注解

默认Border3DStyle.Etched情况下, 此样式用于绘制边框。The Border3DStyle.Etched style is used by default to draw the border.

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide) DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface and sides, and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::Border3DStyle style, System::Windows::Forms::Border3DSide sides);
public static void DrawBorder3D (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.Border3DStyle style, System.Windows.Forms.Border3DSide sides);
static member DrawBorder3D : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.Border3DStyle * System.Windows.Forms.Border3DSide -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

rectangle
Rectangle Rectangle Rectangle

一个 Rectangle,它代表边框尺寸。The Rectangle that represents the dimensions of the border.

style
Border3DStyle Border3DStyle Border3DStyle

Border3DStyle 值之一,它指定边框的样式。One of the Border3DStyle values that specifies the style of the border.

sides
Border3DSide Border3DSide Border3DSide

Border3DSide 值之一,它指定要在上面绘制边框的矩形的边。One of the Border3DSide values that specifies the side of the rectangle to draw the border on.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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
另请参阅

DrawBorder3D(Graphics, Rectangle, Border3DStyle) DrawBorder3D(Graphics, Rectangle, Border3DStyle) DrawBorder3D(Graphics, Rectangle, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle, System::Windows::Forms::Border3DStyle style);
public static void DrawBorder3D (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.Border3DStyle style);
static member DrawBorder3D : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.Border3DStyle -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

rectangle
Rectangle Rectangle Rectangle

一个 Rectangle,它代表边框尺寸。The Rectangle that represents the dimensions of the border.

style
Border3DStyle Border3DStyle Border3DStyle

Border3DStyle 值之一,它指定边框的样式。One of the Border3DStyle values that specifies the style of the border.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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
另请参阅

DrawBorder3D(Graphics, Rectangle) DrawBorder3D(Graphics, Rectangle) DrawBorder3D(Graphics, Rectangle)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

public:
 static void DrawBorder3D(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle rectangle);
public static void DrawBorder3D (System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle);
static member DrawBorder3D : System.Drawing.Graphics * System.Drawing.Rectangle -> unit

参数

graphics
Graphics Graphics Graphics

要进行绘制的 GraphicsThe Graphics to draw on.

rectangle
Rectangle Rectangle Rectangle

一个 Rectangle,它代表边框尺寸。The Rectangle that represents the dimensions of the border.

示例

下面的代码示例演示如何使用其中一DrawBorder3D种方法。The following code example demonstrates the use of one of the DrawBorder3D methods. 若要运行此示例, 请将以下代码粘贴到导入System.Windows.FormsSystem.Drawing命名空间的窗体中。To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. 请确保窗体Paint的事件与此示例中的事件处理程序相关联。Ensure the form's Paint event is associated with the event handler in this example.

// 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

注解

默认Border3DStyle.Etched情况下, 此样式用于绘制边框。The Border3DStyle.Etched style is used by default to draw the border.

另请参阅

适用于