Ranorex

Form.Location cannot be set

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



Joined: 24 Apr 2007
Posts: 8

PostPosted: Fri Apr 27, 2007 8:06 pm    Post subject: Form.Location cannot be set
[Using RanorexPro 1.1.0.0 in C# with .NET 2.0]

If I have a form, the following code works:
Code: click into code to enlarge
Form form = ... some form ....
int x = form.Location.X;

But if I try to set the location, i.e.:
Code: click into code to enlarge
form.Location.X = 5;

The compiler gives the error: Cannot modify the return value of 'Ranorex.Control.Location' because it is not a variable.

So how do I move a form?

Thanks.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Sat Apr 28, 2007 11:47 am    Post subject:
We have a set operator only for the Location, please set the new location as follows:

Code: click into code to enlarge
Point location = form.Location;
location.X = 5;
form.Location = location;

or

Code: click into code to enlarge
form.Location = new Point(5, form.Location.Y);


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