AutomationElementCollection.Item[Int32] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- index
- Int32
The zero-based index of the element in the collection.
Property Value
The AutomationElement at the specified index.
Exceptions
A negative integer was specified for index
, or index
is greater than or equal to Count.
Examples
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET