获取后,AutomationElement
我IsContentElement
使用以下方法获取属性:
bool isContentElement = (bool)element.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty);
Console.WriteLine(isContentElement);
我的应用程序中的输出True
。
使用 Inspect.exe(从https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdkIsContentElement
安装)的值为False
。
我 99% 确定我的应用程序和 Inspect.exe 正在查看元素(相同的边界框、相同的控件类型、相同的名称 - 文件资源管理器 Windows 10 中垂直滚动条的向下箭头)。
似乎也适用于其他属性。为什么他们不匹配?