Forum Discussion

esramirez's avatar
esramirez
Contributor
14 years ago

FindChild: Is it case sensitive?

I have a wpf application and the UI object I am working with has similar name as another one at different level in the object tree.



For example:



Root

-----WPFObject("Component")

-------Child1

---------WPFObject("component")



I need to find the object at the lower level; that is "component" but FindChild finds the object "Component" with the capital 'C' first.



Is there a way to tell FindChild to treat all names as case sensitive?



thoughts? 
  • juliacherk's avatar
    juliacherk
    New Contributor


    PropNames parameter in FindChild method could be an array




    An array of strings containing the names of properties or a single property name.  The method returns an object by the values of these properties (property).


  • Hi Enrique,





    You can either use additional identification criteria, as suggested by Yuliya, or limit the search depth to find WPFObject("Component") first and then use WPFObject("Component").FindChild to find WPFObject("component").


  • thanks allen & Yuliya I am going to try both of the suggestions provided.