IntervalsCount: Integer;
IntervalsCount: Integer;
The IntervalsCount property determines the number of color scale intervals.
If the TabFormatScaleType.Linear scale type is used, the IntervalsCount property can be used to get the number of formed intervals.
If the TabFormatScaleType.EqualValues type is used, the required number of intervals should be set in the IntervalsCount property. The color must be specified for each interval in the Color property.
To execute the example a form with the button on it named Button1, the TabSheetBox component named TabSheetBox1 name and a data source for TabSheetBox1 are required.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Tab: ITabSheet;
Range: ITabRange;
FormCond: ITabFormatCondition;
Scale: ITabFormatScale;
Begin
Tab := TabSheetBox1.Source.GetTabSheet;
Range := Tab.View.Selection.Range;
FormCond := Range.FormatConditions.Add;
FormCond.Type := TabConditionType.Scale;
Scale := FormCond.Details As ITabFormatScale;
Scale.ScaleType := TabFormatScaleType.EqualValues;
Scale.IntervalsCount := 4;
Scale.UseAutoColors := False;
Scale.Color(0) := GxColor.FromName("Cyan");
Scale.Color(1) := GxColor.FromName("Aquamarine");
Scale.Color(2) := GxColor.FromName("Coral");
Scale.Color(3) := GxColor.FromName("Chocolate");
End Sub Button1OnClick;
Clicking the buttons adds the conditional format for the selected cell range. Conditional formatting is performed as a color scale with four intervals. Individual color is determined for each interval.
To execute the example a form with the button on it named Button1, TabSheetBoxNet component named TabSheetBoxNet1 name and some data source for TabSheetBoxNet1 are required.
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Tab;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Tab: ITabSheet;
Range: ITabRange;
FormCond: ITabFormatCondition;
Scale: ITabFormatScale;
GxColorCls: GxColorClassClass = New GxColorClassClass();
Begin
Tab := TabSheetBoxNet1.Source.GetTabSheet();
Range := Tab.View.Selection.Range;
FormCond := Range.FormatConditions.Add();
FormCond.Type := TabConditionType.tctScale;
Scale := FormCond.Details As ITabFormatScale;
Scale.ScaleType := TabFormatScaleType.tfstEqualValues;
Scale.IntervalsCount := 4;
Scale.UseAutoColors := False;
Scale.Color[0] := GxColorCls.FromName("Cyan");
Scale.Color[1] := GxColorCls.FromName("Aquamarine");
Scale.Color[2] := GxColorCls.FromName("Coral");
Scale.Color[3] := GxColorCls.FromName("Chocolate");
End Sub;
Clicking the buttons adds the conditional format for the selected cell range. Conditional formatting is performed as a color scale with four intervals. Individual color is determined for each interval.
See also: