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

このパターンを使用してSelectionItem、要素が選択されているかどうかを判断します (明らかに、すべての AutomationElement がこのパターンを実装しているわけではなく、実際に選択できるものだけが実装されています。そうでない場合は、IsFocusedプロパティを使用できます)。

于 2013-08-10T10:00:24.807 に答える