views:

74

answers:

1

Forms have a property called StartPosition which I can set to one of the members of the FormStartPosition enum. For example is one of them called WindowsDefaultLocation and another is called CenterParent.

Now lets say I wanted to create a button that moved a form to its windows default position, to the center of the screen or center of its parent. In this case the form would already be on screen, so the StartPosition property wouldn't be of much use, so I would need to get that value in a different way. Is this possible?

+1  A: 

No you cannot use the FormStartPosition enum once the form has already loaded.

You will need to set the 'Location' property - coordinates of the top left corner of the form as per your needs.

Sesh
Yes, that of course makes sense. But is there a different way of getting that value for i.e. `Location` that *would* have been used *if* `StartPosition` and `FormStartPosition` had been used?
Svish