NPOI设置单元格背景色在网上有好多例子都是设置为NPOI内置的颜色值 但是想用rgb值来设置背景色,即:通过HSSFPalette类获取颜色值时会抛出异常:Could not Find free color index 比如:http://www.cnblogs.com/yxhblog/p/6225018.html 最后找到 这个实现后才知道需要额外设置一步 http://www.cnblogs.com/huxiaolin/p/4813518.html 简化后代码如下: private voi
npoi设置数据有效性 public void SetDataValidate(ISheet sheet, int firstCol, int lastCol) { CellRangeAddressList regions = new CellRangeAddressList(1, 65535, firstCol, lastCol); DVConstraint constraint = DVConstraint.CreateDateConstraint( (int)ComparisonOpera
给View控件设置边框,可以动态设置上下左右.通过布局文件就能搞定 1.在drawable文件夹下新建一个shape_main_list_bg.xml文件 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- This is the main color --> <item> <shape> <!-- 边框颜色 --> <