WindowStateManager

A simple class written in C# that handles persisting window size, location, and state between sessions of an application
Download

WindowStateManager Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Publisher Name:
  • Benjamin Hollis
  • Operating Systems:
  • Windows All
  • File Size:
  • 3 KB

WindowStateManager Tags


WindowStateManager Description

The WindowStateManager was designed to be a simple class written in C# that handles persisting window size, location, and state between sessions of an application. It's meant for use with Windows Forms applications. To use WindowStateManager, simply create an instance of WindowStateManager and set its Parent property to the form you want to save. Then you have a choice: you can either load and save the WindowStateManager to an XML file by calling its Load and Save methods, or you can include it in another class that's already being serialized back and forth from XML, like the settings file for your app (that's what I do). WindowStateManager does the rest! It saves the position of the form, the size of the form, and the state it was in (Minimized, Maximized, or Normal). Furthermore, it stores a separate set of sizes and positions for each resolution, so that the window doesn't get screwed up when the user changes resolutions (for example, when docking and undocking a laptop).


WindowStateManager Related Software