I’m writing an MDI Application in C#. I’d like a way to store the positions and contents of all the open windows, so that a user can customize the way multiple documents are viewed. Is there a simple way to do this, or will I have to roll my own solution?
Share
I’ve seen a few form persistence classes around but they didn’t do exactly what I needed. I ended up rolling my own, essentially doing the following:
DoSave() just stores this info off in some XML file in the user’s space, but you could store it differently, of course.
When appropriate, such as at startup, I have a ReadSettings() method that essentially reverses the process, interrogating the saved settings, setting the values. There might be a more elegant solution to the problem, but this one has worked really well for me.
Hope that helps.