Aspose.Cells 设置背景颜色
2016-06-07 14:18
567 查看
很多小伙伴设置背景颜色都不起作用,特别提醒需要加入下面一行:
style.Pattern = BackgroundType.Solid;
Aspose.Cells.Style style = null; int index = workbook.Styles.Add(); style = workbook.Styles[index]; //文本颜色 style.Font.Color = Color.Red; style.Font.Size = 10; //设置背景颜色 style.ForegroundColor = System.Drawing.Color.Silver; style.Pattern = BackgroundType.Solid; style.Font.IsBold = true; style.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Center; style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin; //应用边界线 左边界线 style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin; //应用边界线 右边界线 style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin; //应用边界线 上边界线 style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin; //应用边界线 下边界线 Aspose.Cells.Range w = cells.CreateRange(row, col, 1, 1); w.ApplyStyle(style, new StyleFlag() { All=true});
相关文章推荐
- visual studio 无法查看aspx源代码
- ASP.NET MVC 5调用其他Action
- Raspberry - 树莓派系统安装
- ASP.NET中,HiddenField隐藏控件的用法
- ASP.NET中,HiddenField隐藏控件的用法
- 【Asp.Net】五大对象
- ASP.NET调用word出错
- asp.net在word页眉插入条形码
- ASP.NET Core 中文文档
- 源码的说明 ASP.NET MVC 5框架揭秘.zip
- asp.net控件汇总
- asp.net 网页的跳转
- Asp.net页面生存周期
- IIS是如何处理ASP.NET请求的
- ASP.NET Web API 通过参数控制返回类型(JSON|XML)
- Aspose.Words操作word生成PDF文档
- asp.net 下载文件
- AspnetIdentitySample
- Asp.Net 利用反射获得委托和事件以及创建委托实例和添加事件处理程序
- jasperreports+iReport+jatoolsPrinter制作报表笔记