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

検索する行のインデックス
検索を開始する列の1つ前の列インデックス(列0から開始する場合は-1)
モデル内の行の空でない次の列のインデックスを返します。
構文
'宣言
 
Public Overridable Function ConditionalFormatNextNonEmptyColumnInRow( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As Integer
public virtual int ConditionalFormatNextNonEmptyColumnInRow( 
   int row,
   int column
)

パラメータ

row
検索する行のインデックス
column
検索を開始する列の1つ前の列インデックス(列0から開始する場合は-1)

戻り値の型

行内の条件付き書式を含む次のセルの列インデックスを表す Integer。条件付き書式を含む列がない場合は -1
解説
このメソッドは非推奨になりました。
使用例
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");
}

int i;
i =((FarPoint.Win.Spread.IConditionalFormatSupport)fpSpread1.ActiveSheet.Models.Style).ConditionalFormatNextNonEmptyColumnInRow(1,
-1);
MessageBox.Show("The next non-empty column is " + i.ToString());
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 i As Integer
i = CType(FpSpread1.ActiveSheet.Models.Style, FarPoint.Win.Spread.IConditionalFormatSupport).ConditionalFormatNextNonEmptyColumnInRow(1,
-1)
MessageBox.Show("The next non-empty column is " & i.ToString())
参照

DefaultSheetStyleModel クラス
DefaultSheetStyleModel メンバ

開発者ガイド

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

 

 


© MESCIUS inc. All rights reserved.