Find Form by its Name
-
- Posts: 3
- Joined: Mon Oct 02, 2006 7:20 am
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
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:
Jenö Herget
Ranorex Team
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: Select all
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;
}
}
Ranorex Team