PowerTools SPREAD for Windows Forms 8.0J
FillRange(Int32,Int32,Int32,Int32,Int32,FillDirection) メソッド


コピーする範囲の開始セルの行インデックス
コピーする範囲の開始セルの列インデックス
コピーする範囲の行数
コピーする範囲の列数
指定した範囲のコピー先の行数または列数
指定した範囲をコピーする方向
指定した範囲を指定した方向にコピーすることによって、このシートのセル範囲にデータを入力します。
構文
'Declaration
 
Public Overloads Sub FillRange( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer, _
   ByVal fillCount As Integer, _
   ByVal fillDirection As FillDirection _
) 
'使用法
 
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim fillCount As Integer
Dim fillDirection As FillDirection
 
instance.FillRange(row, column, rowCount, columnCount, fillCount, fillDirection)
public void FillRange( 
   int row,
   int column,
   int rowCount,
   int columnCount,
   int fillCount,
   FillDirection fillDirection
)

パラメータ

row
コピーする範囲の開始セルの行インデックス
column
コピーする範囲の開始セルの列インデックス
rowCount
コピーする範囲の行数
columnCount
コピーする範囲の列数
fillCount
指定した範囲のコピー先の行数または列数
fillDirection
指定した範囲をコピーする方向
例外
例外説明
System.ArgumentOutOfRangeException指定された行インデックスは無効です。有効な値は-1から行の総数までです。
System.ArgumentOutOfRangeException指定された列インデックスは無効です。有効な値は-1から列の総数までです。
System.ArgumentOutOfRangeException指定された行数は無効です。有効な値は-1、または0から 「行の総数-現在の行インデックス」までです。
System.ArgumentOutOfRangeException指定された列数は無効です。有効な値は-1、または0から 「列の総数-現在の列インデックス」までです。
System.ArgumentOutOfRangeException指定された行数または列数(fillCount)が有効ではありません。-1、または0から行または列の総数までの値を指定する必要があります。
System.ComponentModel.InvalidEnumArgumentException指定されたデータ入力方向が有効ではありません。設定可能な列挙設定の1つを指定する必要があります。
解説
デフォルトの動作では、すべてのセル設定がコピーされます。データのみを入力するには、他のオーバーロードを使用し、dataOnly パラメータに True を指定します。
次のサンプル コードは、セル範囲にオートフィルでデータとスタイルを入力します。
//  Define the text to repeat.
fpSpread1.ActiveSheet.Cells[0, 0].Text = "A1-text";
fpSpread1.ActiveSheet.Cells[0, 1].Text = "A2-text";
fpSpread1.ActiveSheet.Cells[1, 0].Text = "B1-text";
fpSpread1.ActiveSheet.Cells[1, 1].Text = "B2-text";

fpSpread1.ActiveSheet.Cells[0, 0].BackColor = Color.Cyan;
fpSpread1.ActiveSheet.Cells[0, 0].ForeColor = Color.DarkBlue;
fpSpread1.ActiveSheet.Cells[0, 1].BackColor = Color.Coral;
fpSpread1.ActiveSheet.Cells[0, 1].ForeColor = Color.DarkRed;

// Fill three more columns to the right with the two columns' contents.
fpSpread1.ActiveSheet.FillRange(0, 1, 2, 1, 3, FillDirection.Right);

// Fill four more rows down with the contents of the square 
//  of two rows and two columns.
fpSpread1.ActiveSheet.FillRange(0, 0, 2, 2, 4, FillDirection.Down);


' Define the text to repeat.
fpSpread1.ActiveSheet.Cells(0, 0).Text = "A1-text"
fpSpread1.ActiveSheet.Cells(0, 1).Text = "A2-text"
fpSpread1.ActiveSheet.Cells(1, 0).Text = "B1-text"
fpSpread1.ActiveSheet.Cells(1, 1).Text = "B2-text"

fpSpread1.ActiveSheet.Cells(0, 0).BackColor = Color.Cyan
fpSpread1.ActiveSheet.Cells(0, 0).ForeColor = Color.DarkBlue
fpSpread1.ActiveSheet.Cells(0, 1).BackColor = Color.Coral
fpSpread1.ActiveSheet.Cells(0, 1).ForeColor = Color.DarkRed

' Fill three more columns to the right with the two columns' contents.
fpSpread1.ActiveSheet.FillRange(0, 1, 2, 1, 3, FillDirection.Right)

' Fill four more rows down with the contents of the square 
'  of two rows and two columns.
fpSpread1.ActiveSheet.FillRange(0, 0, 2, 2, 4, FillDirection.Down)

参照

SheetView クラス
SheetView メンバ
オーバーロード一覧

 

 


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