Sprache

AutomationElementCollection.Item[Int32] Eigenschaft

Definition

Ruft den AutomationElement am angegebenen Index ab.

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

Parameter

index
Int32

Der nullbasierte Index des Elements in der Auflistung.

Eigenschaftswert

Der AutomationElement am angegebenen Index.

Ausnahmen

Eine negative ganze Zahl wurde für index, oder index größer als oder gleich ist Countangegeben .

Beispiele

Im folgenden Beispiel wird das erste Element aus einem 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

Gilt für: