This documentation is archived and is not being maintained.

ControlCollection.CopyTo Method

Copies the child controls stored in the ControlCollection object to an System.Array object, beginning at the specified index location in the Array.

[Visual Basic]
Public Overridable Sub CopyTo( _
   ByVal array As Array, _
   ByVal index As Integer _
) Implements ICollection.CopyTo
[C#]
public virtual void CopyTo(
 Array array,
 int index
);
[C++]
public: virtual void CopyTo(
 Array* array,
 int index
);
[JScript]
public function CopyTo(
   array : Array,
 index : int
);

Parameters

array
The Array to copy the child controls to.
index
The zero-based relative index in array where copying begins.

Implements

ICollection.CopyTo

Exceptions

Exception Type Condition
ArgumentException Thrown if array is not a null reference (Nothing in Visual Basic) and not one-dimensional.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ControlCollection Class | ControlCollection Members | System.Web.UI Namespace | Control.Controls | Array

Show: