문제

I have a Custom type, under which I have multiple TextBox controls. the problem is all the TextBox's doesn't have either an Automation Id or the Name. So, I wanted to retrieve all the textboxes in a list, so that, I can operate upon them. I know it's not a good practice to do so but I don't have any other option. The problem is how do I retrieve all the these TextBox's which are under a particular custom type in a List?

If anyone knows a better way around then please suggest.

올바른 솔루션이 없습니다

다른 팁

Condition condition = new PropertyCondition(AutomationElement.ClassNameProperty, "customclassname");
AutomationElementCollection TextBoxs = ListThatContainsTextBoxsAutomationElement.FindAll(TreeScope.Children, condition);
 Foreach(AutomationElement TextBox in TextBoxs) 
 {
    //Do something with the TextBoxs
 }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top