Border

Border class

Encapsulates the object that represents the cell border.

public class Border

Properties

Name Description
ArgbColor { get; set; } Gets and sets the color with a 32-bit ARGB value.
Color { get; set; } Gets or sets the Color of the border.
LineStyle { get; set; } Gets or sets the cell border type.
ThemeColor { get; set; } Gets and sets the theme color of the border.

Examples

[C#]
Workbook workbook = new Workbook();

WorksheetCollection sheets = workbook.Worksheets;
Cell cell = sheets[0].Cells["A1"];

Style style = cell.GetStyle();
//Set top border style and color
Border border = style.Borders[BorderType.TopBorder];
border.LineStyle = CellBorderType.Medium;
border.Color = Color.Red;
cell.SetStyle(style);

[Visual Basic]
Dim workbook as Workbook  = New Workbook()

Dim sheets as WorksheetCollection  = workbook.Worksheets
Cell cell = sheets(0).Cells("A1");
Dim style as Style = cell.GetStyle()
'Set top border style and color
Dim border as Border = style.Borders(BorderType.TopBorder)
border.LineStyle = CellBorderType.Medium
border.Color = Color.Red
cell.SetStyle(style);

See Also