Resize Application Window

Ask general questions here.
rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Resize Application Window

Post by rj-nora » Mon May 10, 2010 4:25 pm

Hello!

I'm trying to resize my Application under test doing something like this:

Ranorex.Form APPWindow = "/form[@controlname=APP]";
Ranorex.Control myControl = TaktWindow.As<Control>();
myControl.SetPropertyValue("Size", new Size(300, 200));
but it´s not working,
Ranorex tells that Control is an ambiguous reference. How can i do that?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Resize Application Window

Post by Support Team » Mon May 10, 2010 4:43 pm

Hi!

Use "Ranorex.Control" instead of "Control" if you have a "using System.Windows.Forms" in your code file.

BTW we have a blog about resizing windows. Please take a look on following link
http://www.ranorex.com/blog/resize-window

Regards,
Peter
Ranorex Support Team
.
Image

rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Re: Resize Application Window

Post by rj-nora » Mon May 10, 2010 5:16 pm

Thanks but nothing is happening when Ranorex play the test.. the application Window still maximized.

Thank you

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Resize Application Window

Post by Ciege » Mon May 10, 2010 5:35 pm

I am curious if the issue is you cannot change the size of a maximized window. Maybe you need to restore the window before you can change the size.
Try doing a form.restore then applying your window size change.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Re: Resize Application Window

Post by rj-nora » Mon May 10, 2010 6:02 pm

Ciege wrote:I am curious if the issue is you cannot change the size of a maximized window. Maybe you need to restore the window before you can change the size.
Try doing a form.restore then applying your window size change.

Thanks one mor time Ciege problem solve!!