Lenguaje

AutomationElementCollection.Item[Int32] Propiedad

Definición

Obtiene en AutomationElement 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

en AutomationElement el índice especificado.

Excepciones

Se especificó un entero negativo para indexo es mayor o index igual que Count.

Ejemplos

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