您可以用条件格式,数据为零 foreColor 设置为何背景色一样
- FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule unary = new FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule(FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo, 0);
- unary.Operator = FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo;
- unary.Value = 0;
- unary.ForeColor = Color.White;
- FpSpread1.Sheets[0].ConditionalFormatting.Add(new FarPoint.Web.Spread.ConditionalFormatting(new CellRange(0, 0, 3, 3), unary));
复制代码 |