ControlPaint.DrawBorder3D 方法

定义

在控件上绘制三维样式边框。

重载

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

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。

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

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。

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

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。

DrawBorder3D(Graphics, Rectangle, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。

DrawBorder3D(Graphics, Rectangle)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。

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

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, style As Border3DStyle, sides As Border3DSide)

参数

graphics
Graphics

要进行绘制的 Graphics

x
Int32

矩形边框左上角的 x 坐标。

y
Int32

矩形边框左上角的 y 坐标。

width
Int32

矩形边框的宽度。

height
Int32

矩形边框的高度。

style
Border3DStyle

Border3DStyle 值之一,它指定边框的样式。

sides
Border3DSide

在其上绘制边框的矩形的 Border3DSide

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

另请参阅

适用于

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

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer, style As Border3DStyle)

参数

graphics
Graphics

要进行绘制的 Graphics

x
Int32

矩形边框左上角的 x 坐标。

y
Int32

矩形边框左上角的 y 坐标。

width
Int32

矩形边框的宽度。

height
Int32

矩形边框的高度。

style
Border3DStyle

Border3DStyle 值之一,它指定边框的样式。

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

另请参阅

适用于

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

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, x As Integer, y As Integer, width As Integer, height As Integer)

参数

graphics
Graphics

要进行绘制的 Graphics

x
Int32

矩形边框左上角的 x 坐标。

y
Int32

矩形边框左上角的 y 坐标。

width
Int32

矩形边框的宽度。

height
Int32

矩形边框的高度。

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

注解

Border3DStyle.Etched默认情况下, 样式用于绘制边框。

适用于

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

在控件上指定的边界内、指定的图形表面和边上绘制具有指定样式的三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, rectangle As Rectangle, style As Border3DStyle, sides As Border3DSide)

参数

graphics
Graphics

要进行绘制的 Graphics

rectangle
Rectangle

一个 Rectangle,它代表边框尺寸。

style
Border3DStyle

Border3DStyle 值之一,它指定边框的样式。

sides
Border3DSide

Border3DSide 值之一,它指定要在上面绘制边框的矩形的边。

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

另请参阅

适用于

DrawBorder3D(Graphics, Rectangle, Border3DStyle)

在控件上指定的边界内、指定的图形表面上绘制具有指定样式的三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, rectangle As Rectangle, style As Border3DStyle)

参数

graphics
Graphics

要进行绘制的 Graphics

rectangle
Rectangle

一个 Rectangle,它代表边框尺寸。

style
Border3DStyle

Border3DStyle 值之一,它指定边框的样式。

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

另请参阅

适用于

DrawBorder3D(Graphics, Rectangle)

在控件上指定的边界内、指定的图形表面上绘制三维样式边框。

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
Public Shared Sub DrawBorder3D (graphics As Graphics, rectangle As Rectangle)

参数

graphics
Graphics

要进行绘制的 Graphics

rectangle
Rectangle

一个 Rectangle,它代表边框尺寸。

示例

下面的代码示例演示如何使用 其中 DrawBorder3D 一个方法。 若要运行此示例,请将以下代码粘贴到导入 System.Windows.FormsSystem.Drawing 命名空间的窗体中。 确保窗体的 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

注解

Border3DStyle.Etched默认情况下, 样式用于绘制边框。

另请参阅

适用于