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.

适用于