0

是否有任何方法可以获取是否选择了 AutomationElement。我使用以下代码来获取一个 AutomationElement 对象。

System.Windows.Point point = new System.Windows.Point(Cursor.Position.X, Cursor.Position.Y);
AutomationElement  element = AutomationElement.FromPoint(point);
//how to know element is selected or not
4

1 回答 1

0

Use the SelectionItem pattern to determine if an element is selected or not (obviously, not all AutomationElements implement this pattern -- only those that can actually be selected. In case they don't, you may use the IsFocused property).

于 2013-08-10T10:00:24.807 回答