I want to change start position by point with code in C#.I know how change start position to center screen but I don't know how set it on points How ?
Asked
Active
Viewed 392 times
0
-
3Look into the [Form.Location](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.location?view=netframework-4.7.2) property, which you can get or set the Point that represents the upper-left corner of the Form in screen coordinates. Also you need to set the `Form.StartPosition = FormStartPosition.Manual;` [Setting StartPosition](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.formstartposition?view=netframework-4.7.2) if you are going to provide the coordinates... – Trevor Apr 03 '19 at 14:52
-
Do you want to change the location of the form to a location on the screen, or do you just want to change the location of a label of button on the form? – Livo Apr 03 '19 at 14:54
-
No, is not enough to set the Location. You need to set the StartPosition to FormStartPosition.Manual – Steve Apr 03 '19 at 14:54
-
See also SO question: [How to fit Windows Form to any screen resolution?](https://stackoverflow.com/questions/5074917/how-to-fit-windows-form-to-any-screen-resolution/19727923#19727923) with answers showing how to set position and location of the form. – Olivier Jacot-Descombes Apr 03 '19 at 14:58