ITabFormatConditions.Count

Syntax

Count: Integer;

Description

The Count property returns the number of conditional formats in the collection.

Example

To execute the example a form with a button on it named Button1, the TabSheetBox component with the TabSheetBox1 name and a component which serves as the data source for TabSheetBox1 are required.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Tab: ITabSheet;

Format: ITabFormatCondition;

i: Integer;

Begin

Tab := TabSheetBox1.Source.GetTabSheet;

For i := 0 To Tab.FormatConditions.Count - 1 Do

Format := Tab.FormatConditions.Item(i);

Debug.Write("Range: " + Format.Range.Address + " Condition: ");

Select Case Format.Type As Integer

Case 0: Debug.WriteLine("Formatting based on cell values");

Case 1: Debug.WriteLine("Formatting a cell with the specified value");

Case 2: Debug.WriteLine("Formatting cells with the maximum/minimum values");

Case 3: Debug.WriteLine("Formatting cells with above-average/below-average values");

Case 4: Debug.WriteLine("Formatting cells with unique/duplicate values");

Case 5: Debug.WriteLine("Formatting cells meeting formula criteria");

End Select;

End For;

End Sub Button1OnClick;

After you have executed this example and pressed the button, the console displays a list containing the name of the cell range and the type of the conditional formatting applied to this table range.

See also:

ITabFormatConditions