how to change location of a form?

chidambaram

Well-known member
Joined
Dec 27, 2007
Messages
62
Location
Chennai,India
Programming Experience
Beginner
hi everybody,

I want to change the location of a button in a form. How can i do this?


I tried as

button1.location.X = 550

It shows the error as cannot modify the return value of "System.Windows.Forms.Control.Location" because it is not a variable.

how can i rectify this?


Thanks in advance
 
If you want to change just the horizontal position you set the Left property. If you want to set just the vertical position you set the Top property. If you want to set both you create a Point object and assign it to the Location property.
 
Back
Top