missing Element.Control method

Ask general questions here.
jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

missing Element.Control method

Post by jabelshauser » Thu Jan 15, 2009 7:49 am

why it isn't possible to go from element-level to control level ?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Thu Jan 15, 2009 9:52 am

There is such a property in the Element class in Ranorex 1.5.1:

Code: Select all

Control control = element.Control;
If this does not work, i.e. the property returns null, then you can use the Control.FromPoint method, it returns the control object at the given point. The argument specifies the point in screen coordinates.

Code: Select all

public static Control FromPoint(Point point)
Sample:

Code: Select all

Control control = Control.FromPoint(element.Location);
Jenö
Ranorex Team

jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

Post by jabelshauser » Fri Jan 16, 2009 11:17 am

is this Feature in Version 1.5.1 also avaliable for .Net 1.1 ?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Fri Jan 16, 2009 12:53 pm

Yes, these features are also available for .Net 1.1.

Regards,
Alex
Ranorex Support Team