回复 1楼zjutwb的帖子
通过设置公式
-
- //Set D公式
- this.fpSpread1.ActiveSheet.SetFormula(0, 3, "COUNTIF(C:C, C1)"); //D列
- this.fpSpread1.ActiveSheet.SetFormula(1, 3, "COUNTIF(C:C, C2)"); //D列
- this.fpSpread1.ActiveSheet.SetFormula(2, 3, "COUNTIF(C:C, C3)"); //D列
- //设置 D判断颜色
- UnaryComparisonConditionalFormattingRule bigOne = new UnaryComparisonConditionalFormattingRule(UnaryComparisonOperator.GreaterThan, "1", true);
- bigOne.BackColor = Color.Orange;
- bigOne.Priority = 9;
- fpSpread1.ActiveSheet.SetConditionalFormatting(new FarPoint.Win.Spread.Model.CellRange[] {
- new FarPoint.Win.Spread.Model.CellRange(0, 3, 3, 1)}, new FarPoint.Win.Spread.IConditionalFormattingRule[] {
- bigOne});
复制代码
测试截图1:
测试截图2:
|