ITabFormatRankValues.Count

Syntax

Count: Integer;

Description

The Count property determines the number of greatest/least values of cells, which should 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: ITabFormatRankValues;
    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.MinMax;
    ValFormat := FormCond.Details As ITabFormatRankValues;
    ValFormat.Count := 4;
    ValFormat.Style := Style;
    ValFormat.Type := TabFormatRankType.Bottom;
End Sub Button1OnClick;

After executing the example, when the button is clicked, a conditional format will be added for the selected cell range, which applies to cells with greatest/least values. The cells containing for least values will be displayed in white font on black background.

See also:

ITabFormatRankValues