Domanda

I'm using System.Windows.Automation to get some UI control text values from labels in a group box. I'm trying to use spy++ to get the control names I'm looking for.

enter image description here

AutomationElement Root = AutomationElement.RootElement;
AutomationElement MainForm = Root.FindFirst(TreeScope.Descendants,new PropertyCondition(AutomationElement.AutomationIdProperty,"control name im looking for"));

What value represents what I would be searching for? For example would I change it to... ...AutomationIdProperty,"Window 00031BB0"));

I'm not sure what all the information given by spy++ actually represents.

Thank you for any help!

È stato utile?

Soluzione

You're looking for the UI Automation Inspector, part of the Windows SDK, which shows the complete UI automation tree.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top