Class Borders
Represents the border formatting for all four edges of a cell or range.
Inherited Members
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class Borders : AbstractBorders
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Examples
// Create borders with uniform styling
var borders = new Borders(BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin);
borders.Color = Color.Black;
Constructors
Borders()
Constructs the default borders with None style and no color.
Declaration
public Borders()
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(Border)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(Border border)
Parameters
| Type | Name | Description |
|---|---|---|
| Border | border |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(Border, Border, Border, Border)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(Border left, Border top, Border right, Border bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| Border | left | |
| Border | top | |
| Border | right | |
| Border | bottom |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(BorderStyle)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(BorderStyle s)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | s |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(BorderStyle, BorderStyle, BorderStyle, BorderStyle)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(BorderStyle left, BorderStyle top, BorderStyle right, BorderStyle bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | left | |
| BorderStyle | top | |
| BorderStyle | right | |
| BorderStyle | bottom |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(BorderStyle, BorderStyle, BorderStyle, BorderStyle, SpreadsheetColor)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(BorderStyle left, BorderStyle top, BorderStyle right, BorderStyle bottom, SpreadsheetColor color)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | left | |
| BorderStyle | top | |
| BorderStyle | right | |
| BorderStyle | bottom | |
| SpreadsheetColor | color |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(BorderStyle, BorderStyle, BorderStyle, BorderStyle, Color)
Initializes a new Borders for the supplied workbook data.
Declaration
public Borders(BorderStyle left, BorderStyle top, BorderStyle right, BorderStyle bottom, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | left | |
| BorderStyle | top | |
| BorderStyle | right | |
| BorderStyle | bottom | |
| Color | color |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Borders(Borders)
Constructs a borders class based on the specified borders instance.
Declaration
public Borders(Borders borders)
Parameters
| Type | Name | Description |
|---|---|---|
| Borders | borders |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Properties
Bottom
Specifies the bottom border of the cell.
Declaration
public override Border Bottom { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Diagonal
Specifies the diagonal border of the cell.
Declaration
public override Border Diagonal { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Horizontal
Specifies the horizontal border (for range formatting).
Declaration
public override Border Horizontal { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Left
Specifies the left border of the cell.
Declaration
public override Border Left { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Right
Specifies the right border of the cell.
Declaration
public override Border Right { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Top
Specifies the top border of the cell.
Declaration
public override Border Top { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Vertical
Specifies the vertical border (for range formatting).
Declaration
public override Border Vertical { get; set; }
Property Value
| Type | Description |
|---|---|
| Border |
Overrides
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
Methods
CreateBoxBorder(BorderStyle)
Exposes the create box border associated with Borders.
Declaration
public static Borders CreateBoxBorder(BorderStyle borderStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | borderStyle | The border style used by the operation. |
Returns
| Type | Description |
|---|---|
| Borders | The create box border returned by the operation. |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
CreateBoxBorder(BorderStyle, SpreadsheetColor)
Exposes the create box border associated with Borders.
Declaration
public static Borders CreateBoxBorder(BorderStyle borderStyle, SpreadsheetColor color)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | borderStyle | The border style used by the operation. |
| SpreadsheetColor | color | The color used by the operation. |
Returns
| Type | Description |
|---|---|
| Borders | The create box border returned by the operation. |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.
CreateBoxBorder(BorderStyle, Color)
Exposes the create box border associated with Borders.
Declaration
public static Borders CreateBoxBorder(BorderStyle borderStyle, Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| BorderStyle | borderStyle | The border style used by the operation. |
| Color | color | The color used by the operation. |
Returns
| Type | Description |
|---|---|
| Borders | The create box border returned by the operation. |
Remarks
A Borders object manages the left, top, right, and bottom borders of a cell,
as well as optional diagonal borders. Each edge can have different styles and colors.
Use this class to apply consistent border formatting across multiple cells.