ToolboxItemCollection.CopyTo(ToolboxItem[], Int32) 方法

定义

将集合复制到指定的数组,从指定的目标索引开始。

public:
 void CopyTo(cli::array <System::Drawing::Design::ToolboxItem ^> ^ array, int index);
public void CopyTo (System.Drawing.Design.ToolboxItem[] array, int index);
member this.CopyTo : System.Drawing.Design.ToolboxItem[] * int -> unit
Public Sub CopyTo (array As ToolboxItem(), index As Integer)

参数

array
ToolboxItem[]

要复制到的数组。

index
Int32

起始复制位置的索引。

示例

下面的代码示例演示如何使用 CopyToToolboxItemCollection方法。

// Copy the ToolboxItemCollection to the specified array.
array<ToolboxItem^>^items = gcnew array<ToolboxItem^>(collection->Count);
collection->CopyTo( items, 0 );
// Copy the ToolboxItemCollection to the specified array.
ToolboxItem[] items = new ToolboxItem[collection.Count];
collection.CopyTo( items, 0 );
' Copy the ToolboxItemCollection to the specified array.
Dim items(collection.Count) As ToolboxItem
collection.CopyTo(items, 0)

适用于