CheckedListBox.CheckedItemCollection.CopyTo(Array, Int32) 方法

定義

將整個集合複製到現有陣列中的指定位置。Copies the entire collection into an existing array at a specified location within the array.

public:
 virtual void CopyTo(Array ^ dest, int index);
public void CopyTo (Array dest, int index);
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit
Public Sub CopyTo (dest As Array, index As Integer)

參數

dest
Array

目的陣列。The destination array.

index
Int32

dest 中以零起始的相對索引,位於複製開始的位置。The zero-based relative index in dest at which copying begins.

實作

例外狀況

arraynullarray is null.

array 是多維的。array is multidimensional.

index 小於零。index is less than zero.

來源 Array 中的元素數目大於從索引至目的端 Array 結尾的可用空間。The number of elements in the source Array is greater than the available space from index to the end of the destination Array.

來源 Array 的類型無法自動轉換成目的 Array 的類型。The type of the source Array cannot be cast automatically to the type of the destination Array.

備註

您可以使用這個方法, 將多個集合中選取的索引結合成單一陣列。You can use this method to combine the selected indexes from multiple collections into a single array.

適用於