ITabFormatDuplicate.Type

Syntax

Type: TabFormatDuplicateType;

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: ITabFormatDuplicate;

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.Duplicate;

ValFormat := FormCond.Details As ITabFormatDuplicate;

ValFormat.Style := Style;

ValFormat.Type := TabFormatDuplicateType.Duplicate;

End Sub Button1OnClick;

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

See also:

ITabFormatDuplicate