ListBox.ObjectCollection.ICollection.CopyTo(Array, Int32) 方法

定義

從特定的陣列索引開始,將集合的項目複製到陣列。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

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

參數

destdestination
Array

一維陣列,是從 ICollection 複製過來之項目的目的端。 陣列必須有以零為起始的索引。

index
Int32

陣列中以零為起始的索引,而且複製會從該位置開始。

實作

例外狀況

此陣列型別與 ListBox.ObjectCollection 中的項目不相容。

.NET 5 和更新版本: destinationnull

備註

這個成員是明確介面成員實作, 只有在 ListBox.ObjectCollection 執行個體轉換成 ICollection 介面時,才能使用這個成員。

適用於