xPost
Ranorex 1.2
.Net 2.0
I've just upgraded to Ranorex 1.2
When I go to recompile I get an error for every instance of
"Control <control> = <Form>.GetFocus()"
Investigation shows that this method is missing from the latest release.
Cheers
Gryphyn
Missing GetFocus() method
I tried the following code with the VS2005Application.exe and it worked for me:Investigation shows that this method is missing from the latest release.
Code: Select all
for (int i = 0; i < 60; i++)
{
Control control = Form.GetFocus();
Console.WriteLine("Control = {0}", control.GetType());
Application.Sleep(1000);
}
Jenö
Ranorex Team
OK.
The method is not missing, it's changed to a static method.
--Intellisense couldn't/can't find it.
but this is still a change from previous versions where GetFocus() was a valid method for any Form object.
This now means that my code needs to bring the appropriate FORM into focus, before checking which CONTROL is in focus. (I'm assuming the static method is using the focused FORM)
-- off to branch my code stream --
(old code needs to compile against earlier Ranorex versions.)
A simple upgrade got awfully messy...
Cheers
Gryphyn
The method is not missing, it's changed to a static method.
--Intellisense couldn't/can't find it.
but this is still a change from previous versions where GetFocus() was a valid method for any Form object.
This now means that my code needs to bring the appropriate FORM into focus, before checking which CONTROL is in focus. (I'm assuming the static method is using the focused FORM)
-- off to branch my code stream --
(old code needs to compile against earlier Ranorex versions.)
A simple upgrade got awfully messy...
Cheers
Gryphyn
GetFocus attaches to the currently activ form and returns the control that has the keyboard focus.This now means that my code needs to bring the appropriate FORM into focus, before checking which CONTROL is in focus. (I'm assuming the static method is using the focused FORM)
I checked the version history in Subversion. The function seems to be the same except that the function is static.
Sorry for the inconvenience.
Jenö
Ranorex Team