Ranorex

Find Form by its Name

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



Joined: 02 Oct 2006
Posts: 3

PostPosted: Tue Oct 10, 2006 9:56 am    Post subject: Find Form by its Name
can you create new method in Class Application to can Find Form by its Name as title and class name
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Tue Oct 10, 2006 10:47 pm    Post subject:
Good idea, we will implement this function for a future version.
We have code freeze at the moment, we test the next version 0.9.4 and will release it this week.
But the good news, we implemented a new property ClassName for the Control class and you can find easily a top level window with a specified title and class name in V0.9.4 as follows:

Code: click into code to enlarge
Form form = null;
Application.GetForms();
foreach (Form topform in Application.Forms)
{
    if( topform.Text == "title" && topform.ClassName == "className")
    {
        form = topform;
        Console.WriteLine("Handle={0} Location={1} Text={2} ClassName={3}", 
                form.Handle, form.Location, form.Text, form.ClassName);
        break;
    }
}


Jenö Herget
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