uiautomation 如何获取 statusbar 的每一项内容

ilikeff8 2018-05-03 05:28:16

condition = new PropertyCondition(AutomationElement.AutomationIdProperty, "statusStrip1");
condition2 = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.StatusBar);
andConditon = new AndCondition(condition, condition2);

element = rootElement.FindFirst(TreeScope.Descendants, andConditon);

if (element != null)
{
//condition = new PropertyCondition(AutomationElement.AutomationIdProperty, "Statusbar.Pane1");
condition = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit);

var statusbar = element.FindFirst(TreeScope.Descendants, condition);


statusStrip1 状态条本身是可以获取的,但其中的项目不管是用AutomationId还是ControlType控件类型,都无法获取到,
是不是只能用句柄去获取
...全文
211 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧