As per the description in chm file for the Form.GetControls()...
"Gets an array containing all controls in the form . ". However the declaration returns a void.
GetControls() returns void pointer.
The function GetControls() makes a connection to the automated form, reads all controls and fills the Form property Controls. For speed reasons (the testapplication runs in an other process space) the function will not called in the constructor of the Form class.
Call the GetControls() function to read and fill the control array.
See also the sample project RanorexVS2005Sample4
Gabor
Ranorex Team
Call the GetControls() function to read and fill the control array.
See also the sample project RanorexVS2005Sample4
Code: Select all
form.GetControls();
foreach (Control control in form.Controls)
{
IntPtr handle = control.Handle;
Point location = control.Location;
Size size = control.Size;
String text = control.Text;
Console.WriteLine("Handle={0} Location={1} Text={2}", handle, location, text);
}
Ranorex Team
-
- Posts: 6
- Joined: Sat Mar 17, 2007 6:50 pm
May I suggest that you rename this method "PopulateControls"?
I made the same mistake in thinking the method was prototyped incorrectly.
I also noticed that Element.GetChildCount is a property, and so conventionally ought to be named "Element.ChildCount".
I'm not beating you guys up, I like this product!
Best regards
David D
I made the same mistake in thinking the method was prototyped incorrectly.
I also noticed that Element.GetChildCount is a property, and so conventionally ought to be named "Element.ChildCount".
I'm not beating you guys up, I like this product!
Best regards
David D
Yes you are right, i also unhappy with these functions and properties.
We also discussed this topic and decided to be compatible in V1.1.0 and V1.2.0 with every previous versions.
(Every Ranorex version is compatible with every previous one at the moment)
But we will add new functions and properties in the future and eliminate some old ones.
Jenö
Ranorex Team
We also discussed this topic and decided to be compatible in V1.1.0 and V1.2.0 with every previous versions.
(Every Ranorex version is compatible with every previous one at the moment)
But we will add new functions and properties in the future and eliminate some old ones.
Good idea, "PopulateControls" would be a better name, we will consider about it.david_dawkins wrote:May I suggest that you rename this method "PopulateControls"?
Jenö
Ranorex Team