In This Article

SimpleBorder Class

Provides a class that draws a simple border.

[TypeConverter(typeof(SimpleBorderConverter))]
public class SimpleBorder : Border, ICloneable
Inheritance:
object Border object
Implements:
ICloneable

Constructors

SimpleBorder()

Initializes an instance of the class.

public SimpleBorder()

SimpleBorder(SimpleBorder)

Initializes an instance of the class.

protected SimpleBorder(SimpleBorder copyFrom)
Parameter Type Description
copyFrom SimpleBorder

An instance of SimpleBorder which will be copied to initialize the new instance.

Remarks

This constructor used in support of Clone() for base classes to initialize their fields.

SimpleBorder(SimpleBorderStyle, Color)

Initializes an instance of the class.

public SimpleBorder(SimpleBorderStyle style, Color color)
Parameter Type Description
style SimpleBorderStyle

The SimpleBorderStyle specifying the border type.

color Color

The base Color of the border.

Properties

Color

The base color of the border.

public Color Color { get; set; }

Property Value

Color

ColorAlpha

The color alpha value.

public byte ColorAlpha { get; set; }

Property Value

byte

Style

The style of the border.

public SimpleBorderStyle Style { get; set; }

Property Value

SimpleBorderStyle

Methods

Clone()

Creates an exact duplicate of the Border object.

public override Border Clone()

Returns

Border

Draw(Graphics, Rectangle, Sides)

Draws the border.

public override void Draw(Graphics g, Rectangle bounds, Sides sides)
Parameter Type Description
g Graphics

The Graphics object used to paint.

bounds Rectangle

The bounds of the area to paint.

sides Sides

The Sides of the border to draw.

Draw(Graphics, Rectangle, SimpleBorderStyle, Color)

Draws a border.

public static void Draw(Graphics g, Rectangle bounds, SimpleBorderStyle borderStyle, Color borderColor)
Parameter Type Description
g Graphics

The Graphics object used to paint.

bounds Rectangle

The bounds of the border.

borderStyle SimpleBorderStyle

The SimpleBorderStyle specifying the border type.

borderColor Color

The base Color of the border.

Draw(Graphics, Rectangle, SimpleBorderStyle, Color, Sides)

Draws a border.

public static void Draw(Graphics g, Rectangle bounds, SimpleBorderStyle borderStyle, Color borderColor, Sides sides)
Parameter Type Description
g Graphics

The Graphics object used to paint.

bounds Rectangle

The bounds of the border.

borderStyle SimpleBorderStyle

The SimpleBorderStyle specifying the border type.

borderColor Color

The base Color of the border.

sides Sides

The Sides of the border to draw.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)
Parameter Type Description
obj object

The object to compare with the current object.

Returns

bool:

true if the specified object is equal to the current object; otherwise, false.

GetBorderWidth()

The width of the border.

public override int GetBorderWidth()

Returns

int

GetBorderWidth(SimpleBorderStyle)

Returns the width of the border for the specified SimpleBorderStyle.

public static int GetBorderWidth(SimpleBorderStyle borderStyle)
Parameter Type Description
borderStyle SimpleBorderStyle

A SimpleBorderStyle specifying the type of border to measure.

Returns

int

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int:

A hash code for the current object.

GetPrimaryColor()

Returns the primary Color of the border.

public override Color GetPrimaryColor()

Returns

Color

ResetColor()

Resets the Color property to its default value.

public virtual void ResetColor()

ResetStyle()

Resets the Style property to its default value.

public virtual void ResetStyle()

ShouldSerializeColor()

Indicates whether the Color property should be persisted.

public virtual bool ShouldSerializeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeStyle()

Indicates whether the Style property should be persisted.

public virtual bool ShouldSerializeStyle()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Inherited Members

Extension Methods