ITabSheet.FormatConditions

Syntax

FormatConditions: ITabFormatConditions;

Description

The FormatConditions property returns the collection of conditional formats, applied to some table cell ranges.

Example

Executing the example requires 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.

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 executing the example and clicking 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:

ITabSheet