Share via


AutomationElementCollection.Item[Int32] Propiedad

Definición

Obtiene el objeto AutomationElement en el índice especificado.

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

Parámetros

index
Int32

Índice de base cero del elemento de la colección.

Valor de propiedad

AutomationElement

Objeto AutomationElement en el índice especificado.

Excepciones

Se ha especificado un entero negativo para indexo index es mayor o igual que Count.

Ejemplos

En el ejemplo siguiente, el primer elemento se recupera de .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

Se aplica a