2010-08-16 126 views
2

我正在實現WPF應用程序,我想使用System.Windows.Automation命名空間從應用程序中捕獲高位文本。System.Windows.Automation命名空間問題

問題是Visual Studio和Expression不識別AutomationElement,TreeScope,TextPattern和Red強調它!我在Windows 7上使用Visual Studio 2010 Professional和Expression 4.在此先感謝:)

回答

3

您需要添加UIAutomationClient.dll及其依賴關係作爲參考。儘管名稱空間是可見的,但並不是所有的類都在同一個Assembly中。

+0

感謝他的工作,但TextPatternRange仍然沒有:) – 2010-08-16 21:08:55

+0

它在UIAutomationClient程序集中,但它在System.Windows.Automation.Text命名空間中。你有正確的命名空間嗎? – 2010-08-16 21:12:28

+0

對不起,我錯過了包括System.Windows.Automation.Text命名空間 謝謝你(Y) – 2010-08-16 21:13:48