SpecificText: String;
The SpecificText property determines the text, to which cell values should be compared to define, whether they satisfy the condition, set in the TextCondition property.
The property is used, if ContentType is set to the SpecificText value. When a condition by text is used, it is necessary to consider the character case.
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: ITabFormatCellContent;
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.CellContent;
ValFormat := FormCond.Details As ITabFormatCellContent;
ValFormat.ContentType := TabFormatContentType.SpecificText;
ValFormat.SpecificText := "abc";
ValFormat.TextCondition := TabConditionCellContentText.Contains;
ValFormat.Style := Style;
End Sub Button1OnClick;
As a result, when the button is clicked, for the selected cell range a conditional format will e added, which applies to cells with certain values. Cell values, containing the "abc" character combination, will be displayed in white font on black background.
See also: