PowerTools SPREAD for Windows Forms 8.0J
GetEnumerator メソッド (ISheetSpanModel)


行インデックス
列インデックス
連結セル内の行数
連結セル内の列数
コレクション内で指定した連結セルの後にある次の連結セルを列挙する列挙子を取得します。
構文
'Declaration
 
Function GetEnumerator( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As IEnumerator
'使用法
 
Dim instance As ISheetSpanModel
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim value As IEnumerator
 
value = instance.GetEnumerator(row, column, rowCount, columnCount)
IEnumerator GetEnumerator( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

パラメータ

row
行インデックス
column
列インデックス
rowCount
連結セル内の行数
columnCount
連結セル内の列数

戻り値の型

次のセル結合を取得するための IEnumerator オブジェクト
次のサンプルコードは、モデルの列挙子を次のインスタンスに移動します。
FarPoint.Win.Spread.Model.ISheetSpanModel sp;
FarPoint.Win.Spread.Model.CellRange cr;
IEnumerator ie;
DialogResult dlg;
sp = (FarPoint.Win.Spread.Model.ISheetSpanModel)fpSpread1.ActiveSheet.Models.Span;
sp.Add(0, 0, 2, 2);
sp.Add(0, 3, 2, 2);
dlg = MessageBox.Show("Do you want to enumerate through the specified span??", "GetEnumerator", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     bool b;
     ie = sp.GetEnumerator(0, 3, 2, 2);
     b = ie.MoveNext();
     if (b == true)
     {
          cr = (FarPoint.Win.Spread.Model.CellRange)ie.Current;
          label1.Text = "The column is " + cr.Column.ToString() + " and the row is " + cr.Row;
     }
}
Dim sp As FarPoint.Win.Spread.Model.ISheetSpanModel
Dim cr As FarPoint.Win.Spread.Model.CellRange
Dim ie As IEnumerator
Dim dlg As DialogResult
sp = FpSpread1.ActiveSheet.Models.Span
sp.Add(0, 0, 2, 2)
sp.Add(0, 3, 2, 2)
dlg = MessageBox.Show("Do you want to enumerate through the specified span??", "GetEnumerator", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     Dim b As Boolean
     ie = sp.GetEnumerator(0, 3, 2, 2)
     b = ie.MoveNext()
     If b = True Then
          cr = ie.Current()
          Label1.Text = "The column is "  & cr.Column.ToString() & " and the row is " & cr.Row
     End If
End If
参照

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

 

 


© 2004-2015, GrapeCity inc. All rights reserved.