Page 1 of 1

Cant get list of controls properly

Posted: Wed Dec 10, 2008 12:35 am
by din2dino
Hi,

I have this winforms control, where i am trying to retrive the list of controls and pick the one I want based on index.

However the list of controls returned keeps changing. First time controls in the tab and other tab are also returned. When i call the same code second time, it returns the controls in ony that tab.
hence different number of controls returned.

Any solution? There are no IDs/names of the controls.And all are same class.
Thanks

Posted: Wed Dec 10, 2008 11:49 am
by Support Team
Usually, if the state of the application does not change, the order in which controls are returned by Control.Children should not change either. However, the returned children may change if controls are hidden or repositioned. Please, consider that the Control.Children property does not only return the immediate children of the control, but actually all its descendants.

If the tab control you're dealing with is a .Net TabControl, you need to know that controls on a tab page are usually created when the tab page is shown for the first time.

Regards,
Alex
Ranorex Support Team