MESCIUS SPREAD for Windows Forms 15.0J
ConditionalFormatIsRowUsed メソッド (DefaultSheetStyleModel)
使用例 

行インデックス
モデル内の行にスタイル設定が含まれるかどうかを判定します。
構文
'宣言
 
Public Overridable Function ConditionalFormatIsRowUsed( _
   ByVal row As Integer _
) As Boolean
public virtual bool ConditionalFormatIsRowUsed( 
   int row
)

パラメータ

row
行インデックス

戻り値の型

Boolean:指定した行に条件付き書式が設定されている場合は True、それ以外の場合は False

解説
このメソッドは非推奨になりました。
使用例
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");
}

bool b;
b =((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).ConditionalFormatIsRowUsed(1);
if(b == true)
{
     MessageBox.Show("The row is used.");
}
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

Dim b As Boolean
b = CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).ConditionalFormatIsRowUsed(1)
If b = True Then
     MessageBox.Show("The row is used.")
End If
参照

DefaultSheetStyleModel クラス
DefaultSheetStyleModel メンバ

開発者ガイド

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

 

 


© MESCIUS inc. All rights reserved.