BorderType

BorderType enumeration

指定边框的边。

要了解更多信息,请访问使用文档编程文档文章。

public enum BorderType

价值观

姓名价值描述
None-1默认值。
Bottom0指定段落或表格单元格的下边框。
Left1指定段落或表格单元格的左边框。
Right2指定段落或表格单元格的右边框。
Top3指定段落或表格单元格的上边框。
Horizontal4指定表格中单元格之间或一致段落之间的水平边框。
Vertical5指定表格中单元格之间的垂直边框。
DiagonalDown6指定表格单元格中的对角边框。
DiagonalUp7指定表格单元格中的对角边框。

例子

演示如何插入带有上边框的段落。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Border topBorder = builder.ParagraphFormat.Borders.Top;
topBorder.LineWidth = 4.0d;
topBorder.LineStyle = LineStyle.DashSmallGap;
// 仅当设置了 LineWidth 或 LineStyle 时才设置 ThemeColor。
topBorder.ThemeColor = ThemeColor.Accent1;
topBorder.TintAndShade = 0.25d;

builder.Writeln("Text with a top border.");

doc.Save(ArtifactsDir + "Border.ParagraphTopBorder.docx");

也可以看看