Page 1 of 1
How to know a Form is resizeable
Posted: Thu Jul 29, 2010 10:50 am
by atom
Hiya
On the Form class there is a method Resize
How to know if a Form is resizeable, so that Resize should work?
Thanks
Re: How to know a Form is resizeable
Posted: Thu Jul 29, 2010 12:57 pm
by Support Team
Hi,
Sorry but there is no such property or method to check if the window is resizeable, but you can try following method:
private static bool CheckIfResizeable(int x, int y, Ranorex.Form form)
{
form.Resize(x,y);
if(form.ScreenRectangle.Size == new Size(x,y))
{
Report.Log(ReportLevel.Info,"Resizeable","True");
return true;
}
else
{
Report.Log(ReportLevel.Info,"Resizeable","False");
return false;
}
}
But this method depends on the technology of your application.
Regards,
Peter
Ranorex Support team
Re: How to know a Form is resizeable
Posted: Thu Jul 29, 2010 1:46 pm
by atom
ok thanks, the Resize method doesnt throw any exception if it cant resize?
Re: How to know a Form is resizeable
Posted: Thu Jul 29, 2010 2:15 pm
by Support Team
Hi,
Resize throws an exception if the invoking actions fail, but doesn't check if the resize was successfully done.
Regards,
Peter
Ranorex Team