Language

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 。

例外

indexに負の整数が指定されているか、indexがCount以上です。

例

次の例では、最初の要素が 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

適用対象