AutomationElementCollection.Item[Int32] 속성

정의

지정된 인덱스의 AutomationElement를 가져옵니다.

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

매개 변수

index
Int32

컬렉션에서 요소의 인덱스(0부터 시작)입니다.

속성 값

AutomationElement

지정한 인덱스에 있는 AutomationElement입니다.

예외

index에 음수가 지정되었거나 indexCount보다 크거나 같은 경우

예제

다음 예제에서는 첫 번째 요소에서 검색 됩니다는 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

적용 대상