Border

Border class

封装表示单元格边框的对象。

public class Border

特性

姓名 描述
ArgbColor { get; set; } 使用 32 位 ARGB 值获取和设置颜色。
Color { get; set; } 获取或设置Color边界的.
LineStyle { get; set; } 获取或设置单元格边框类型。
ThemeColor { get; set; } 获取和设置边框的主题颜色。

例子

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

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

Style style = cell.GetStyle();
//设置上边框样式和颜色
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()
'设置顶部边框样式和颜色
Dim border as Border = style.Borders(BorderType.TopBorder)
border.LineStyle = CellBorderType.Medium
border.Color = Color.Red
cell.SetStyle(style);

也可以看看