ITabFormatRankValues.Count

Syntax

Count: Integer;

Description

The Count property determines the number of maximum/minimum values of cells, which should be formatted.

Example

To execute the example a form, a button on this form named Button1, a TabSheetBox component named TabSheetBox1 and a data source for this component are required.

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;

As a result when the button is clicked, a conditional format will be added for the selected cell range, which applies to cells with maximum/minimum values. The cells containing for minimum values will be displayed in white font on black background.

See also:

ITabFormatRankValues