語言

DataGridViewSelectedCellCollection.CopyTo(DataGridViewCell[], Int32) 方法

定義

將集合中的元素複製到指定的 DataGridViewCell 陣列,從指定的索引開始。

public:
 void CopyTo(cli::array <System::Windows::Forms::DataGridViewCell ^> ^ array, int index);
public void CopyTo(System.Windows.Forms.DataGridViewCell[] array, int index);
override this.CopyTo : System.Windows.Forms.DataGridViewCell[] * int -> unit
Public Sub CopyTo (array As DataGridViewCell(), index As Integer)

參數

array
DataGridViewCell[]

一維陣列,型別 DataGridViewCell 為 ,是從集合複製元素的目的地。 陣列必須具有零基索引。

index
Int32

複製開始的零基索引 array 。

例外狀況

array 是 null。

index 小於零。

array 是多維的。

-或-

元素 DataGridViewCellCollection 數大於從 index 到 末 array端的可用空間。

無法 DataGridViewCellCollection 自動施放為 的 array類型。

適用於

另請參閱