MaxValue: Variant;
The MaxValue property determines the value of the condition, by which cells with maximum values will be selected.
To execute the example a form, a button on this form named Button1, the 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: ITabFormatValues;
Begin
Tab := TabSheetBox1.Source.GetTabSheet;
Range := Tab.View.Selection.Range;
FormCond := Range.FormatConditions.Add;
FormCond.Type := TabConditionType.Values;
ValFormat := FormCond.Details As ITabFormatValues;
//three-color gradient for cell formatting
ValFormat.Style := TabFormatValuesStyle.ThreeColorScale;
//setting minimum value
ValFormat.MinValueType := TabFormatValueType.Percent;
ValFormat.MinValue := 10;
ValFormat.MinValueColor := GxColor.FromName("Red");
//setting middle value
ValFormat.MidValueType := TabFormatValueType.Percent;
ValFormat.MidValue := 50;
ValFormat.MidValueColor := GxColor.FromName("Blue");
//setting maximum value
ValFormat.MaxValueType := TabFormatValueType.Percent;
ValFormat.MaxValue := 90;
ValFormat.MaxValueColor := GxColor.FromName("Green");
End Sub Button1OnClick;
As a result when the button is clicked, a conditional format will be added for the selected cell range, applied to cells on the basis of their values. Formatting style is the three-color gradient. Formatting is applied to the cells of the selected range, which values are greater than the minimum and smaller than the maximum by 10 percent.
See also: