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

モデルに選択が含まれていないかどうかを判定します。
構文
'宣言
 
Public Overridable Function IsEmpty() As Boolean
public virtual bool IsEmpty()

戻り値の型

Boolean:選択モデルに選択範囲が含まれない場合は True、それ以外の場合は False
使用例
次のサンプルコードは、モデルが空でない場合、選択範囲の色を変更します。
FarPoint.Win.Spread.Model.BaseSheetSelectionModel selModel; 
selModel = (FarPoint.Win.Spread.Model.BaseSheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection; 
selModel.SetSelection(0, 0, 3, 3);

bool b;
b = selModel.IsEmpty();
if(b == false)
{
       fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors;
       fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range;
       fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
       fpSpread1.ActiveSheet.SelectionBackColor = Color.Yellow;
}
Dim selModel As FarPoint.Win.Spread.Model.BaseSheetSelectionModel
selModel = fpSpread1.ActiveSheet.Models.Selection
selModel.SetSelection(0, 0, 3, 3)

Dim b As Boolean
b = selModel.IsEmpty()
If b = False Then
       fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors
       fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range
       fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell
       fpSpread1.ActiveSheet.SelectionBackColor = Color.Yellow
End If
参照

BaseSheetSelectionModel クラス
BaseSheetSelectionModel メンバ

 

 


© MESCIUS inc. All rights reserved.