回复 1楼zjutwb的帖子
用到了IConditionalFormattingRule规则,代码实现如下:
-
- private void SetRuler()
- {
- UnaryComparisonConditionalFormattingRule unaryComparisonConditionalFormattingRule1 = new UnaryComparisonConditionalFormattingRule(UnaryComparisonOperator.GreaterThan, "=A1", true);
- unaryComparisonConditionalFormattingRule1.BackColor = Color.Red;
- unaryComparisonConditionalFormattingRule1.Priority = 8;
- fpSpread1.ActiveSheet.SetConditionalFormatting(new FarPoint.Win.Spread.Model.CellRange[] {
- new FarPoint.Win.Spread.Model.CellRange(0, 1, 500, 1)}, new FarPoint.Win.Spread.IConditionalFormattingRule[] {
- unaryComparisonConditionalFormattingRule1});
- }
复制代码
效果截图:
安装包自带的demo,演示了丰富的类似样例:
|