문제

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...

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top