ImageList.ImageCollection.ICollection.CopyTo(Array, Int32) 方法

定義

將集合中的項目複製到相容的一維陣列 (從目標陣列的指定索引處開始)。

 virtual void System.Collections.ICollection.CopyTo(Array ^ dest, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array dest, int index);
abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit
Sub CopyTo (dest As Array, index As Integer) Implements ICollection.CopyTo

參數

dest
Array

一維 Array,是從集合中複製的元素之目的端。 陣列必須有以零為起始的索引。

index
Int32

Array 中以零起始的索引,即開始複製的位置。

實作

例外狀況

destnull

index 小於 0。

dest 是多維的。

-或-

ComboBox.ObjectCollection 中的項目數大於從 index 至目的陣列結尾的可用空間。

ComboBox.ObjectCollection 的型別無法自動轉換為目的陣列的型別。

適用於