MidValueColor: IGxColor;
The MidValueColor property sets middle color for the gradient or histogram color depending on the formatting style currently applied to cells.
The purpose of this property depends on value of the Style property:
If the Style = TabFormatValuesStyle.ThreeColorScale, this property determines middle color of the gradient.
If the Style = TabFormatValuesStyle.DataBar, this property determines histogram color.
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: 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;
//set up minimum value
ValFormat.MinValueType := TabFormatValueType.Percent;
ValFormat.MinValue := 10;
ValFormat.MinValueColor := GxColor.FromName("Red");
//set up middle value
ValFormat.MidValueType := TabFormatValueType.Percent;
ValFormat.MidValue := 50;
ValFormat.MidValueColor := GxColor.FromName("Blue");
//set up maximum value
ValFormat.MaxValueType := TabFormatValueType.Percent;
ValFormat.MaxValue := 90;
ValFormat.MaxValueColor := GxColor.FromName("Green");
End Sub Button1OnClick;
After executing the example, 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 less than the maximum by 10 percent.
See also: