MESCIUS SPREAD for Windows Forms 15.0J
ComparisonOperator 列挙体
使用例 使用例 

条件書式の演算子を指定します。
構文
'宣言
 
Public Enum ComparisonOperator 
   Inherits System.Enum
public enum ComparisonOperator : System.Enum 
メンバ
メンバ解説
Betweenセル値が2つのパラメータ値の間にあるかどうかを判定します。
EqualToセル値がパラメータ値と等しいかどうかを判定します。
GreaterThanセル値がパラメータ値より大きいかどうかを判定します。
GreaterThanOrEqualToセル値がパラメータ値以上かどうかを判定します。
IsEmptyセルが空かどうかを判定します。
IsFalse数式がFalseかどうかを判定します。
IsTrue数式がTrueかどうかを判定します。
LessThanセル値がパラメータ値より小さいかどうかを判定します。
LessThanOrEqualToセル値がパラメータ値以下かどうかを判定します。
NotBetweenセル値が2つのパラメータ値の間にないかどうかを判定します。
NotEqualToセル値がパラメータ値と等しくないかどうかを判定します。
使用例
次のサンプルコードは、入力されたさまざまな値に基づいてセルの色を変更します。
FarPoint.Win.Spread.NamedStyle styleCold = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleCool = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleMild = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleWarm = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle styleHot = new FarPoint.Win.Spread.NamedStyle();
styleCold.BackColor = Color.Blue;
styleCold.ForeColor = Color.White;
styleCool.BackColor = Color.Cyan;
styleMild.BackColor = Color.Lime;
styleWarm.BackColor = Color.Yellow;
styleHot.BackColor = Color.Red;

if (fpSpread1.ActiveSheet.Models.Style is FarPoint.Win.Spread.IConditionalFormatSupport)
{
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleCold, FarPoint.Win.Spread.ComparisonOperator.LessThanOrEqualTo,
"40");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleCool, FarPoint.Win.Spread.ComparisonOperator.Between,
"40","55");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleMild, FarPoint.Win.Spread.ComparisonOperator.Between,
"55","75");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleWarm, FarPoint.Win.Spread.ComparisonOperator.Between,
"75","85");
 
((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).SetConditionalFormat(1,1,styleHot, FarPoint.Win.Spread.ComparisonOperator.GreaterThan,
"85");
}
Dim styleCold As New FarPoint.Win.Spread.NamedStyle
Dim styleCool As New FarPoint.Win.Spread.NamedStyle
Dim styleMild As New FarPoint.Win.Spread.NamedStyle
Dim styleWarm As New FarPoint.Win.Spread.NamedStyle
Dim styleHot As New FarPoint.Win.Spread.NamedStyle
styleCold.BackColor = Color.Blue
styleCold.ForeColor = Color.White
styleCool.BackColor = Color.Cyan
styleMild.BackColor = Color.Lime
styleWarm.BackColor = Color.Yellow
styleHot.BackColor = Color.Red

FpSpread1.ActiveSheet.Cells(1, 1).Value = 73

If TypeOf FpSpread1.ActiveSheet.Models.Style Is FarPoint.Win.Spread.IConditionalFormatSupport Then

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleCold,
FarPoint.Win.Spread.ComparisonOperator.LessThanOrEqualTo, "40")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleCool,
FarPoint.Win.Spread.ComparisonOperator.Between, "40", "55")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleMild,
FarPoint.Win.Spread.ComparisonOperator.Between, "55", "75")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleWarm,
FarPoint.Win.Spread.ComparisonOperator.Between, "75", "85")

CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).SetConditionalFormat(1, 1, styleHot,
FarPoint.Win.Spread.ComparisonOperator.GreaterThan, "85")

End If
継承階層

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.ComparisonOperator

参照

FarPoint.Win.Spread 名前空間
ComparisonOperator プロパティ (ConditionalFormat クラス)

開発者ガイド

セルの条件付き書式の設定

 

 


© MESCIUS inc. All rights reserved.