ITabFormatAverage.Type

Syntax

Type: TabFormatAverageType;

Description

The Type property determines the type of values to be formatted.

Example

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

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Tab: ITabSheet;
    Range: ITabRange;
    FormCond: ITabFormatCondition;
    ValFormat: ITabFormatAverage;
    Style: ITabCellStyle;
Begin
    Style := New TabCellStyle.Create;
    Style.Font.Color := GxColor.FromName("White");
    Style.BackgroundColor := GxColor.FromName("Black");
    Tab := TabSheetBox1.Source.GetTabSheet;
    Range := Tab.View.Selection.Range;
    FormCond := Range.FormatConditions.Add;
    FormCond.Type := TabConditionType.Average;
    ValFormat := FormCond.Details As ITabFormatAverage;
    ValFormat.Style := Style;
    ValFormat.Type := TabFormatAverageType.EqualAbove;
End Sub Button1OnClick;

As a result, when a button is clicked, for the selected cell range a conditional format will be added, which is applied to the cells with values greater/smaller than the mean value. The cells the values of which are greater or equal to the mean value, are displayed in white font on the black background.

See also:

ITabFormatAverage