Just a information

Class library usage, coding and language questions.
arishahsan
Posts: 26
Joined: Thu Jan 18, 2007 12:04 pm

Just a information

Post by arishahsan » Mon Mar 05, 2007 8:12 am

Can we get the three things programatically using ranorex
1. Active window
2. Focused Control in a form
3. Focused Element in a Control or in a form
If you have any direct command to do so plzz let me know.

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Mon Mar 05, 2007 10:42 pm

arishahsan wrote:1. Active window
The static get property Form.Active retrieves the currently active top level form.
(Works only in V1.1.0 or above)
arishahsan wrote:2. Focused Control in a form


The static get property Form.GetFocus returns the control that has the keyboard focus.
arishahsan wrote:3. Focused Element in a Control or in a form


We don't support this functionality directly at the moment.
But you can read the selected items of the controls or you can use the Focused or Selected flag of the State enumeration.

Jenö

anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Post by anujakulkarni » Wed Feb 11, 2009 3:07 pm

Hi,

I am not able to use the
Form.Active
method while coding in C# using Ranorex.I am using Ranorex evaluation version 2.0.

Please let me know how I can check if a window/dialogbox is active ?

Cheers,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Wed Feb 11, 2009 3:14 pm

What do you mean with "I am not able"?

The Form adapter provides an Active property that is true if the form is the currently active window.

Regards,
Alex
Ranorex Support Team

anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Post by anujakulkarni » Wed Feb 11, 2009 3:18 pm

Well I have a form called FormEnquiry. If I add a statement like

Code: Select all

if(repo.FormEnquiry.Active)
"repo" is an instance of the GlobalRepository, I am geting a compile time error which says
'ACBS2201.GlobalRepositoryFolders.FormEnquiryAppFolder' does not contain a definition for 'Active' and no extension method 'Active' accepting a first argument of type 'ACBS2201.GlobalRepositoryFolders.FormEnquiryAppFolder' could be found (are you missing a using directive or an assembly reference?) (CS1061) - D:\Projects\ACS\Ranorex Projects\ACBS2201\ACBS2201\Program.cs:361,24
Am I missing something?

Cheers,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Wed Feb 11, 2009 3:45 pm

anujakulkarni wrote:Am I missing something?
Yes, the word "Self" :-)

To access the adapter corresponding to a repository folder, use the Self property of the folder:

Code: Select all

if (repo.FormEnquiry.Self.Active)
Regards,
Alex
Ranorex Support Team

anujakulkarni
Posts: 29
Joined: Wed Jan 07, 2009 1:15 pm

Post by anujakulkarni » Wed Feb 11, 2009 4:00 pm

thanks..that was really helpful :D

Is there any documentation where I can check for such missing things rather than bothering you guys every now and then :roll: :P ?

Cheers,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Wed Feb 11, 2009 4:10 pm

There is a documentation for the repository browser, but it does not explain the Self property of rooted folders. We will add that :-)

Regards,
Alex
Ranorex Support Team