I'm trying to have my form start in the same position it was when it last closed.
I've tried setting the 'Start Position' property on the form to 'Manual' and moving/closing/relaunching the application, but I don't see the effect it had.
If set to 'Manual', is there a way to configure it to load on the last position? (It wouldn't be fixed as it could vary)
Other info that might be of help:
-I have multimonitors
-The form does not have a parent
-C# WinForms
-Visual Studio C# 2010 Express
In the "Properties" window of your form go to "Application Settings". Under "Property Binding" choose and add a new "Location" application setting, name it and save it.
Then go to "Events" and add the "FormClosed" event for your form. To save your form's last position call Properties.Settings.Default.Save(); from this event.
If my instructions were not clear enough, try this (and read the second to last comment): https://xldennis.wordpress.com/2010/03/19/preserve-size-and-location-of-windows-forms-part-i/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With