AutomationElement.RootElement 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 root AutomationElement for the current desktop.
public:
static property System::Windows::Automation::AutomationElement ^ RootElement { System::Windows::Automation::AutomationElement ^ get(); };
public static System.Windows.Automation.AutomationElement RootElement { get; }
static member RootElement : System.Windows.Automation.AutomationElement
Public Shared ReadOnly Property RootElement As AutomationElement
Property Value
The root element.
Examples
The following example code retrieves a collection of all the immediate children of the desktop.
AutomationElementCollection desktopChildren =
AutomationElement.RootElement.FindAll(
TreeScope.Children, Condition.TrueCondition);
Dim desktopChildren As AutomationElementCollection
desktopChildren = AutomationElement.RootElement.FindAll( _
TreeScope.Children, Condition.TrueCondition)
Remarks
You can use the root element as a starting point for finding other elements, using the FindAll and FindFirst methods.
When searching from the root element, be sure to specify Children in the scope of the search, not Descendants. A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback을 참조하세요.
출시 예정: 2024년 내내 콘텐츠 피드백 메커니즘인 GitHub 문제를 단계적으로 폐지하고 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은다음에 대한 사용자 의견 제출 및 보기