Taal

AutomationElementCollection.Item[Int32] Eigenschap

Definitie

Haalt de AutomationElement opgegeven index op.

public:
 property System::Windows::Automation::AutomationElement ^ default[int] { System::Windows::Automation::AutomationElement ^ get(int index); };
public System.Windows.Automation.AutomationElement this[int index] { get; }
member this.Item(int) : System.Windows.Automation.AutomationElement
Default Public ReadOnly Property Item(index As Integer) As AutomationElement

Parameters

index
Int32

De op nul gebaseerde index van het element in de verzameling.

Waarde van eigenschap

De AutomationElement opgegeven index.

Uitzonderingen

Er is een negatief geheel getal opgegeven voor index, of index groter dan of gelijk aan Count.

Voorbeelden

In het volgende voorbeeld wordt het eerste element opgehaald uit een AutomationElementCollection.

// desktopChildren is a collection of AutomationElement objects.
AutomationElement firstWindow;
try
{
    firstWindow = desktopChildren[0];
}
catch (IndexOutOfRangeException)
{
    Console.WriteLine("No AutomationElement at that index.");
}
' desktopChildren is a collection of AutomationElement objects.
Dim firstWindow As AutomationElement
Try
    firstWindow = desktopChildren(0)
Catch ex As IndexOutOfRangeException
    Console.WriteLine("No AutomationElement at that index.")
End Try

Van toepassing op