Spread Windows Forms 12.0 Product Documentation
ThreeColorScaleConditionalFormattingRule Constructor(ConditionalFormattingColorValue,ConditionalFormattingColorValue,ConditionalFormattingColorValue,Boolean)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ThreeColorScaleConditionalFormattingRule Class > ThreeColorScaleConditionalFormattingRule Constructor : ThreeColorScaleConditionalFormattingRule Constructor(ConditionalFormattingColorValue,ConditionalFormattingColorValue,ConditionalFormattingColorValue,Boolean)
The minimum value. Note: The minimum value only accepts the ConditionalFormattingColorValue object which has a Type value of Min, Number, Percent, Formula, or Pecentile.
The middle value. Note: The middle value only accepts the ConditionalFormattingColorValue object which has a Type value of Number, Percent, Formula, or Pecentile.
The maximum value. Note: The maximum value only accepts the ConditionalFormattingColorValue object which has a Type value of Max, Number, Percent, Formula, or Pecentile.
true Indicates that the expression, referred to by a custom name, will not be restricted; otherwise, false
Initializes a new instance of the ThreeColorScaleConditionalFormattingRule class.
Syntax
'Declaration
 
Public Function New( _
   ByVal minValue As ConditionalFormattingColorValue, _
   ByVal midValue As ConditionalFormattingColorValue, _
   ByVal maxValue As ConditionalFormattingColorValue, _
   ByVal suppressCustomName As Boolean _
)
'Usage
 
Dim minValue As ConditionalFormattingColorValue
Dim midValue As ConditionalFormattingColorValue
Dim maxValue As ConditionalFormattingColorValue
Dim suppressCustomName As Boolean
 
Dim instance As New ThreeColorScaleConditionalFormattingRule(minValue, midValue, maxValue, suppressCustomName)

Parameters

minValue
The minimum value. Note: The minimum value only accepts the ConditionalFormattingColorValue object which has a Type value of Min, Number, Percent, Formula, or Pecentile.
midValue
The middle value. Note: The middle value only accepts the ConditionalFormattingColorValue object which has a Type value of Number, Percent, Formula, or Pecentile.
maxValue
The maximum value. Note: The maximum value only accepts the ConditionalFormattingColorValue object which has a Type value of Max, Number, Percent, Formula, or Pecentile.
suppressCustomName
true Indicates that the expression, referred to by a custom name, will not be restricted; otherwise, false
Example
This example creates a color scale rule.
fpSpread1.Sheets[0].Cells[0, 0].Value = 30;
fpSpread1.Sheets[0].Cells[1, 0].Value = 20;
fpSpread1.Sheets[0].Cells[1, 1].Value = 10;
fpSpread1.Sheets[0].Cells[0, 2].Value = 15;
FarPoint.Win.Spread.Model.CellRange celRange1 = new FarPoint.Win.Spread.Model.CellRange(0, 0, 3, 3);
FarPoint.Win.Spread.ThreeColorScaleConditionalFormattingRule rule = new FarPoint.Win.Spread.ThreeColorScaleConditionalFormattingRule(new FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.Aqua, 10, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), new FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.BlueViolet, 20, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), new FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.Green, 50, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), false);
fpSpread1.Sheets[0].SetConditionalFormatting(new FarPoint.Win.Spread.Model.CellRange[] { celRange1 }, rule);
fpSpread1.Sheets(0).Cells(0, 0).Value = 30
fpSpread1.Sheets(0).Cells(1, 0).Value = 20
fpSpread1.Sheets(0).Cells(1, 1).Value = 10
fpSpread1.Sheets(0).Cells(0, 2).Value = 15
Dim celRange1 As New FarPoint.Win.Spread.Model.CellRange(0, 0, 3, 3)
Dim Rule As New FarPoint.Win.Spread.ThreeColorScaleConditionalFormattingRule(New FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.Aqua, 10, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), New FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.BlueViolet, 20, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), New FarPoint.Win.Spread.ConditionalFormattingColorValue(Color.Green, 50, FarPoint.Win.Spread.ConditionalFormattingValueType.Number), False)
fpSpread1.Sheets(0).SetConditionalFormatting(New FarPoint.Win.Spread.Model.CellRange() {celRange1}, Rule)
See Also

Reference

ThreeColorScaleConditionalFormattingRule Class
ThreeColorScaleConditionalFormattingRule Members
Overload List