Percent: Double;
The Percent property determines the percent of cells in the selected region, which will be formatted. The property is relevant if the PercentUsed property is set to True.
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.Percent := 15;
ValFormat.PercentUsed := True;
ValFormat.Style := Style;
ValFormat.Type := TabFormatRankType.Top;
End Sub Button1OnClick;
After executing the example, on clicking the button, a conditional format will be added for the selected cell range, which formats cells with maximum or minimum values. Fifteen percent of cells, containing maximum values, will be displayed in white font on black background.
See also: