Aspose.Cells设置单元格背景色

Posted 棉晗榜

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Aspose.Cells设置单元格背景色相关的知识,希望对你有一定的参考价值。

Aspose.Cells.Style rowBg2 = wb.Styles[wb.Styles.Add()];
rowBg2.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
rowBg2.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
rowBg2.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;
rowBg2.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;           
rowBg2.ForegroundColor = System.Drawing.Color.SpringGreen;                   
rowBg2.Pattern = BackgroundType.Solid;.

Aspose.Cells.Range range1 = cells.CreateRange(0, 0, 1, 11);
range1.ApplyStyle(rowBg2, new StyleFlag()  All = true );

以上是关于Aspose.Cells设置单元格背景色的主要内容,如果未能解决你的问题,请参考以下文章