SimpleBorder Class
Provides a class that draws a simple border.
[TypeConverter(typeof(SimpleBorderConverter))]
public class SimpleBorder : Border, ICloneable
- 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.
ColorAlpha
The color alpha value.
Style
The style of the border.
Methods
Clone()
Creates an exact duplicate of the Border object.
Draw(Graphics, Rectangle, Sides)
Draws the border.
public override void Draw(Graphics g, Rectangle bounds, Sides sides)
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | The |
| 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 |
| 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 |
| 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:
trueif the specified object is equal to the current object; otherwise,false.
GetBorderWidth()
The width of the border.
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
GetHashCode()
Serves as the default hash function.
GetPrimaryColor()
Returns the primary Color of the border.
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:
trueif 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:
trueif the property value has changed from its default; otherwise,false.
Inherited Members
- Border.Draw(Graphics, Rectangle)
- Border.GetInnerBounds(Graphics, Rectangle, Sides)
- Border.OnPropertyChanged(EventArgs)
- Border.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)