Dette innholdet er ikke tilgjengelig på ditt språk, men her er den engelske versjonen.
This documentation is archived and is not being maintained.

AutomationElementCollection.CopyTo Method (Array, Int32)

Copies the collection's elements to an array, starting at the specified index in the target array.

Namespace:  System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

Public Overridable Sub CopyTo ( _
	array As Array, _
	index As Integer _


Type: System.Array
The destination of the elements copied from the collection.
Type: System.Int32
The zero-based index in the target array where copying should begin.


ICollection.CopyTo(Array, Int32)

The following example shows how to copy an AutomationElementCollection to an array of objects.

' elementCollection is an AutomationElementCollection.
Dim elementUntypedArray(elementCollection.Count) As Object
elementCollection.CopyTo(elementUntypedArray, 0)

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.