ITabFormatConditions.Item

Fore Syntax

Item(Index: Integer): ITabFormatCondition;

Fore.NET Syntax

Item[Index: integer]: Prognoz.Platform.Interop.Tab.ITabFormatCondition;

Parameters

Index.Index of the conditional format, to which access is required.

Description

The Item property returns a link to the conditional format, the index of which is passed as the Index input parameter.

Fore Example

To execute the example a form that contains the Button component with the Button1 identifier, the TabSheetBox component with the TabSheetBox1 identifier and the UiErAnalyzer component with the UiErAnalyzer1 identifier are required. Specify the UiErAnalyzer1 data source for the TabSheetBox1 component.

The example is a handler of the OnClick event for the Button1 component.

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 on the basis of cells' values");
            
Case 1: Debug.WriteLine("Formatting of a cell with particular value");
            
Case 2: Debug.WriteLine("Formatting of cells with the greatest/least values");
            
Case 3: Debug.WriteLine("Formatting of cells with the values that are greater/less than average");
            
Case 4: Debug.WriteLine("Formatting of cells with unique/duplicate values");
            
Case 5: Debug.WriteLine("Formatting of cells satisfying the 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.

Fore.NET Example

To execute the example a form that contains the Button component with the button1 identifier, the TabSheetBoxNet component with the tabSheetBoxNet1 identifier and the UiErAnalyzerNet component with the uiErAnalyzerNet1 identifier are required. Specify the uiErAnalyzerNet1 data source for the TabSheetBoxNet1 component.

Example is the Click event handler for the Button1 component.

Add a link to the Tab system assembly.

Imports Prognoz.Platform.Interop.Tab;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Tab: ITabSheet;
    Format: ITabFormatCondition;
    i: Integer;
Begin
    Tab := tabSheetBoxNet1.Source.GetTabSheet();
    For i := 0 To Tab.FormatConditions.Count - 1 Do
        Format := Tab.FormatConditions.Item[i];
        System.Diagnostics.Debug.WriteLine("Range: " + Format.Range.Address);
        System.Diagnostics.Debug.WriteLine("Condition: ");
        Select Case Format.Type As Integer
            Case 0: System.Diagnostics.Debug.WriteLine("Formatting on the basis of cells' values");
            Case 1: System.Diagnostics.Debug.WriteLine("Formatting of a cell with particular value");
            Case 2: System.Diagnostics.Debug.WriteLine("Formatting of cells with the greatest/least values");
            Case 3: System.Diagnostics.Debug.WriteLine("Formatting of cells with the values that are greater/less than average";
            Case 4: System.Diagnostics.Debug.WriteLine("Formatting of cells with unique/duplicate values");
            Case 5: System.Diagnostics.Debug.WriteLine("Formatting of cells satisfying the formula");
        End Select;
    End For;
End Sub;

The result of Fore.NET Example execution matches that in the Fore Example.

See also:

ITabFormatConditions