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

選択を列挙する列挙子を取得します。
構文
'宣言
 
Function GetEnumerator() As IEnumerator
IEnumerator GetEnumerator()

戻り値の型

次の選択範囲を取得するための IEnumerator オブジェクト
使用例
次のサンプルコードは、セルの選択範囲を列挙する列挙子を取得します。
FarPoint.Win.Spread.Model.ISheetSelectionModel sel;
IEnumerator se;
bool b;
FarPoint.Win.Spread.Model.CellRange cr;
sel = (FarPoint.Win.Spread.Model.ISheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection;
sel.AddSelection(0, 0, 2, 2);
sel.AddSelection(3, 0, 3, 2);
se = sel.GetEnumerator();
b = se.MoveNext();
if (b == true)
{
cr = (FarPoint.Win.Spread.Model.CellRange)se.Current;
label1.Text = "First selection is Col - " + cr.Column + " Row - " + cr.Row + " Col2 - " + cr.ColumnCount + " Row2 - " + cr.RowCount;
}
Dim sel As FarPoint.Win.Spread.Model.ISheetSelectionModel
Dim se As IEnumerator
Dim b As Boolean
Dim cr As FarPoint.Win.Spread.Model.CellRange
sel = FpSpread1.ActiveSheet.Models.Selection
sel.AddSelection(0, 0, 2, 2)
sel.AddSelection(3, 0, 3, 2)
se = sel.GetEnumerator()
b = se.MoveNext()
If b = True Then
cr = se.Current()
Label1.Text = "First selection is Col - " & cr.Column & " Row - " & cr.Row & " Col2 - " & cr.ColumnCount & " Row2 - " & cr.RowCount
End If
参照

ISheetSelectionModel インターフェース
ISheetSelectionModel メンバ

 

 


© MESCIUS inc. All rights reserved.