Ranorex

Find form by "Control name"

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
david_dawkins



Joined: 17 Mar 2007
Posts: 6

PostPosted: Sat Mar 17, 2007 8:00 pm    Post subject: Find form by "Control name"
Hi,
Amongst other things, RanorexSpy shows me "Class name", "Control name" and "Caption/text". I can see the API in Application to find a form by class name, and by caption text.

However, my application's "Control name" is the key I need to locate its form; how do I do this? It's as if I need Application.FindFormByControlName.

(Caption/text changes too often to be reliable, and the "class name" is junk - anyone know how to set that programmatically?)

Thanks!
DavidD
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Sat Mar 17, 2007 8:56 pm    Post subject:
david_dawkins wrote:
It's as if I need Application.FindFormByControlName.

Good idea, we will support this function in the next version.

But you can find the form easily in V1.1.0:

Code: click into code to enlarge
Application.GetForms();
foreach (Form form in Application.Forms)
{
    if (form.Name == "SearchedForm" )
    {
        form.Activate();
        break;
    }
}

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
david_dawkins



Joined: 17 Mar 2007
Posts: 6

PostPosted: Sat Mar 17, 2007 9:23 pm    Post subject:
Thanks for your reply ; however I have no method Form.Name in the v1.1.0 that I have installed.

Quote:

Error 1 'Ranorex.Form' does not contain a definition for 'Name' C:\Program Files\Ranorex-1.1.0\Samples\RanorexVS2005Sample1\Class1.cs 131 25 Rano rexVS2005Sample1


Intellisense doesn't show it to me, either. The documentation however claims that it should be there.

Thanks
David D
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Sun Mar 18, 2007 4:30 pm    Post subject:
The Name and ControlId property are only supported in the professional version.

Sorry for the missing comment "Supported only in RanorexPro" in the documentation.

We will extend the documentation for the next version.

Jenö
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum