I have been looking around SO and found these two articles:
- Restoring Window Size/Position With Multiple Monitors
- C#: How to make a form remember its Bounds and WindowState (Taking dual monitor setups into account)
The problem is that these article is in the ball park of my problem, yet I can't use them as I see it (unless I make my solution really complicated). While the article talk about restoring a Form when they have closed their application completely, that is not exactly what I am trying is to accomplish.
What I am doing is closing and opening the same form within the same running application. When this happen I want it to have the same exact location, state and size as it where when i closes. This is straight forward because I can save the location, state and size from the form object, dispose it and apply the old values to my new form. This works, but if I have a maximized window on monitor 2, and the close/open function runs, it opens the form maximized on monitor 1.
Is there any easy way to keep it on monitor 2 in the case above, or do I have to dive into complicated libraries?