Skip to main content

TdxSpreadSheetCustomConditionalFormatting.Add(TRect,TdxSpreadSheetCustomConditionalFormattingRuleClass,Untyped) Method

Creates a new rule and adds it to the conditional formatting controller.

Declaration

procedure Add(const AArea: TRect; ARuleClass: TdxSpreadSheetCustomConditionalFormattingRuleClass; out ARule); overload;

Parameters

Name Type
AArea TRect
ARuleClass TdxSpreadSheetCustomConditionalFormattingRuleClass
ARule

Remarks

Call this procedure and pass the target conditional formatting rule’s class-reference as the ARuleClass parameter to create a new rule. The Add procedure returns the rule as the ARule out parameter. Cast ARule to the class corresponding to the ARuleClass reference to access the rule’s type-specific members. The first overloaded procedure variant creates a rule with the default parameters and an empty list of affected cell ranges. To create a conditional formatting rule with a specific target cell range (such as the current cell selection), pass it as the second overloaded variant’s AArea parameter.

Alternatively, you can call the target rule class’ Create constructor and pass the conditional formatting controller as a parameter.

To delete a rule, you can either pass it as the Remove procedure’s parameter or directly call the rule’s Free procedure.

Note

The Rules property provides indexed access to all individual rules in the controller. As in the case of an ARule out parameter value, you need to cast a target property value to the corresponding rule class to access the rule’s type-specific members.

See Also