AutomationElementCollection.Item[Int32] AutomationElementCollection.Item[Int32] AutomationElementCollection.Item[Int32] AutomationElementCollection.Item[Int32] Property

Definição

Obtém o AutomationElement no índice especificado.Gets the AutomationElement at the specified index.

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 Int32 Int32 Int32

O índice com base em zero do elemento na coleção.The zero-based index of the element in the collection.

Valor da propriedade

Exceções

Um inteiro negativo foi especificado para index ou index é maior ou igual a Count.A negative integer was specified for index, or index is greater than or equal to Count.

Exemplos

No exemplo a seguir, o primeiro elemento é recuperado de um AutomationElementCollection.In the following example, the first element is retrieved from an 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

Aplica-se a