PowerTools SPREAD for Windows Forms 8.0J
GetSelections メソッド (IDisjointSelections)


シート内の行数
シート内の列数
選択中のセルを、範囲間の重複を最小限にして、大から小の順序で含む セル範囲の順序配列を取得します。
構文
'Declaration
 
Function GetSelections( _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) As CellRange()
'使用法
 
Dim instance As IDisjointSelections
Dim rowCount As Integer
Dim columnCount As Integer
Dim value() As CellRange
 
value = instance.GetSelections(rowCount, columnCount)
CellRange[] GetSelections( 
   int rowCount,
   int columnCount
)

パラメータ

rowCount
シート内の行数
columnCount
シート内の列数

戻り値の型

選択中のセルを大から小の順序で含むCellRangeオブジェクトの順序配列
次のサンプルコードは、最初の選択範囲の開始行と、2番目の選択範囲の開始列を返します。
FarPoint.Win.Spread.Model.IDisjointSelections djs;
FarPoint.Win.Spread.Model.CellRange[] cr;
djs = (FarPoint.Win.Spread.Model.IDisjointSelections)fpSpread1.ActiveSheet.Models.Selection;
fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);
fpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2);
cr = djs.GetSelections(4, 4);
label1.Text = "The first row in the first selection is " + cr[0].Row + " and the " +
"first column of the second selection is " + cr[1].Column;
Dim djs As FarPoint.Win.Spread.Model.IDisjointSelections
Dim cr As FarPoint.Win.Spread.Model.CellRange()
djs = FpSpread1.ActiveSheet.Models.Selection
FpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2)
FpSpread1.ActiveSheet.AddSelection(0, 3, 2, 2)
cr = djs.GetSelections(4, 4)
Label1.Text = "The first row in the first selection is " & cr(0).Row & " and the " & _
"first column of the second selection is " & cr(1).Column
参照

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

 

 


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