2013-07-30 16 views
0

如果選擇了AutomationElement或沒有選擇,是否有任何方法來獲取。我用下面的代碼來獲得AutomationElement對象。我們如何檢查AutomationElement是否被選中c#

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 
+0

你的意思是'選擇'或'聚焦'? –

回答

0

使用SelectionItem模式,以確定是否選擇或沒有(明顯的一個元素,並非所有AutomationElements實現這種模式 - 只有那些實際上可以選擇的情況下,他們不這樣做,你可以使用IsFocused財產)。

相關問題