Question

I'm having a problem, because I need to get a piece information about AutomationPatterns of Text in Windows Calculator, but GetAutomationPatterns() returns an empty array.

I'm trying to access that in this way:

AutomationElement aeItem = uiitem.AutomationElement;

foreach (AutomationPattern prop in aeItem.GetSupportedPatterns())
    System.Diagnostics.Debug.WriteLine(prop.ProgrammaticName);

How to achieve my goal, cause I need to get a value of that text box and without a pattern it seems to be impossible...

No correct solution

OTHER TIPS

Are you sure the AutomationElement you're looking at is indeed a TextBox? TextBlock, for example, exposes no AutomationPattern whatsoever, and you'll have to use its Name property to get its content.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top