ControlPaint.DrawBorder3D 方法

定義

在控制項上繪製 3D 樣式框線。

多載

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

使用指定的樣式、在指定的圖形表層和側邊,和控制項的指定範圍內繪製 3D 樣式框線。

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

使用指定的樣式,在指定的圖形表層和控制項的指定範圍內繪製 3D 樣式框線。

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

在指定的圖形表層和控制項的指定範圍內,繪製 3D 樣式框線。

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

使用指定的樣式、在指定的圖形表層和側邊,和控制項的指定範圍內繪製 3D 樣式框線。

DrawBorder3D(Graphics, Rectangle, Border3DStyle)

使用指定的樣式,在指定的圖形表層和控制項的指定範圍內繪製 3D 樣式框線。

DrawBorder3D(Graphics, Rectangle)

在指定的圖形表層和控制項的指定範圍內,繪製 3D 樣式框線。

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

使用指定的樣式、在指定的圖形表層和側邊,和控制項的指定範圍內繪製 3D 樣式框線。

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

另請參閱

適用於

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

使用指定的樣式,在指定的圖形表層和控制項的指定範圍內繪製 3D 樣式框線。

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

另請參閱

適用於

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

在指定的圖形表層和控制項的指定範圍內,繪製 3D 樣式框線。

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

備註

樣式 Border3DStyle.Etched 預設會用來繪製框線。

適用於

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

使用指定的樣式、在指定的圖形表層和側邊,和控制項的指定範圍內繪製 3D 樣式框線。

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

另請參閱

適用於

DrawBorder3D(Graphics, Rectangle, Border3DStyle)

使用指定的樣式,在指定的圖形表層和控制項的指定範圍內繪製 3D 樣式框線。

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

另請參閱

適用於

DrawBorder3D(Graphics, Rectangle)

在指定的圖形表層和控制項的指定範圍內,繪製 3D 樣式框線。

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

備註

樣式 Border3DStyle.Etched 預設會用來繪製框線。

另請參閱

適用於