ControlPaint.DrawBorder3D Method

Definition

Draws a three-dimensional style border on a control.

Overloads

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)

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)

Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

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)

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)

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)

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

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.

C#
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);

Parameters

graphics
Graphics

The Graphics to draw on.

x
Int32

The x-coordinate of the top left of the border rectangle.

y
Int32

The y-coordinate of the top left of the border rectangle.

width
Int32

The width of the border rectangle.

height
Int32

The height of the border rectangle.

style
Border3DStyle

One of the Border3DStyle values that specifies the style of the border.

sides
Border3DSide

The Border3DSide of the rectangle to draw the border on.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

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

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

C#
public static void DrawBorder3D(System.Drawing.Graphics graphics, int x, int y, int width, int height, System.Windows.Forms.Border3DStyle style);

Parameters

graphics
Graphics

The Graphics to draw on.

x
Int32

The x-coordinate of the top left of the border rectangle.

y
Int32

The y-coordinate of the top left of the border rectangle.

width
Int32

The width of the border rectangle.

height
Int32

The height of the border rectangle.

style
Border3DStyle

One of the Border3DStyle values that specifies the style of the border.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

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

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

C#
public static void DrawBorder3D(System.Drawing.Graphics graphics, int x, int y, int width, int height);

Parameters

graphics
Graphics

The Graphics to draw on.

x
Int32

The x-coordinate of the top left of the border rectangle.

y
Int32

The y-coordinate of the top left of the border rectangle.

width
Int32

The width of the border rectangle.

height
Int32

The height of the border rectangle.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

Remarks

The Border3DStyle.Etched style is used by default to draw the border.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawBorder3D(Graphics, Rectangle, Border3DStyle, Border3DSide)

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

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.

C#
public static void DrawBorder3D(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.Border3DStyle style, System.Windows.Forms.Border3DSide sides);

Parameters

graphics
Graphics

The Graphics to draw on.

rectangle
Rectangle

The Rectangle that represents the dimensions of the border.

style
Border3DStyle

One of the Border3DStyle values that specifies the style of the border.

sides
Border3DSide

One of the Border3DSide values that specifies the side of the rectangle to draw the border on.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawBorder3D(Graphics, Rectangle, Border3DStyle)

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

Draws a three-dimensional style border with the specified style, on the specified graphics surface, and within the specified bounds on a control.

C#
public static void DrawBorder3D(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle, System.Windows.Forms.Border3DStyle style);

Parameters

graphics
Graphics

The Graphics to draw on.

rectangle
Rectangle

The Rectangle that represents the dimensions of the border.

style
Border3DStyle

One of the Border3DStyle values that specifies the style of the border.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawBorder3D(Graphics, Rectangle)

Source:
ControlPaint.cs
Source:
ControlPaint.cs
Source:
ControlPaint.cs

Draws a three-dimensional style border on the specified graphics surface and within the specified bounds on a control.

C#
public static void DrawBorder3D(System.Drawing.Graphics graphics, System.Drawing.Rectangle rectangle);

Parameters

graphics
Graphics

The Graphics to draw on.

rectangle
Rectangle

The Rectangle that represents the dimensions of the border.

Examples

The following code example demonstrates the use of one of the DrawBorder3D methods. To run this example, paste the following code in a form that imports the System.Windows.Forms and System.Drawing namespaces. Ensure the form's Paint event is associated with the event handler in this example.

C#
// 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);
}

Remarks

The Border3DStyle.Etched style is used by default to draw the border.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9