Just a information
-
- Posts: 26
- Joined: Thu Jan 18, 2007 12:04 pm
Just a information
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.
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.
The static get property Form.Active retrieves the currently active top level form.arishahsan wrote:1. Active window
(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ö
-
- Posts: 29
- Joined: Wed Jan 07, 2009 1:15 pm
- Support Team
- Site Admin
- Posts: 12174
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
-
- Posts: 29
- Joined: Wed Jan 07, 2009 1:15 pm
Well I have a form called FormEnquiry. If I add a statement like "repo" is an instance of the GlobalRepository, I am geting a compile time error which says
Cheers,
Code: Select all
if(repo.FormEnquiry.Active)
Am I missing something?'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
Cheers,
- Support Team
- Site Admin
- Posts: 12174
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Yes, the word "Self"anujakulkarni wrote:Am I missing something?

To access the adapter corresponding to a repository folder, use the Self property of the folder:
Code: Select all
if (repo.FormEnquiry.Self.Active)
Alex
Ranorex Support Team
-
- Posts: 29
- Joined: Wed Jan 07, 2009 1:15 pm
- Support Team
- Site Admin
- Posts: 12174
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
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

Regards,
Alex
Ranorex Support Team