1

I'm retrieving controls (children of a toolstrip), but the list isn't complete throught the code, while Inspect.exe is retrieving the full list.

The only useful information is that the "Cancel" and "Validate" ToolStripButtons are instantiated dynamically (programmatically).

I did not found any explanation. Has someone something about this ?

Thanks & Greetings

On these screenshots, the common parent is toolStrip1 (toolbar), the code shows all children displayed in Inspect.exe but the last three ("", "Cancel", and "Validate").

In Inspect.exe In Code Visual Studio Watch

  • I guess Grip and Separators are NOT being returned as controls. Total 18 Elements - 1 Grip - 3 Separators = 14 Elements. – sallushan Oct 17 '18 at 10:00
  • Thanks @sallushan for the answer. Grip and Separators was retrieved, I just got three buttons not found in the list, where the one I wanted was, solved as below. – Sauveur Dominguez Oct 17 '18 at 11:35

1 Answers1

1

Solved.

The problem was I used the UIAutomation library from Visual Studio Enterprise 2017, but that its version is a bit obsolete. So I decided to use an "extended version" (according to me) called UIAComWrapper which has extended attributes for AutomationElement and allows to retrieve the complete list of controls.

So UIAComWrapper do the job.

This answer will be marked as Solution asap.