ITabFormatConditions.Count

Syntax

Count: Integer;

Description

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

Example

Executing the example requires a form with the Button1 button located on it, the TabSheetBox component with the TabSheetBox1 name and a component which serves as the data source for TabSheetBox1.

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("Format cells based on their values");
            Case 1: Debug.WriteLine("Format cells with definite value");
            Case 2: Debug.WriteLine("Format cells with greatest/least values");
            Case 3: Debug.WriteLine("Format cells with values greater/less than average");
            Case 4: Debug.WriteLine("Format cells with unique/duplicate values");
            Case 5: Debug.WriteLine("Format cells satisfying a formula");
        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