找不到System.Windows.Point。

7
我正在使用 UIAutomation 方法。
System.Windows.Automation.AutomationElement.FromPoint(System.Windows.Point)

通过鼠标光标获取元素,但我找不到类型 System.Windows.Point。我查了对象库,但仍然没找到。
我正在使用 .Net Framework 4.5。

5
System.Windows.Point 是 WPF 的一部分,如果您尝试在 WinForms 应用程序中执行此操作,则不受支持。 - Peter Ritchie
31
添加一个对"WindowsBase"的引用。 - Hans Passant
@HansPassant,您能否将该评论转换为答案? - T.Todua
2个回答

0
System.Windows.Point是WPF的一部分,如果你在WinForms应用程序中尝试做这个,它是不受支持的。 - Peter Ritchie 2014年10月4日0时10分

0
正如@HansPassant所说,您必须添加对“WindowsBase”的引用。 我只是添加答案,因为评论可能会被忽视。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接