WindowState 1.2.0

Library to help save and restore window states.

Install-Package WindowState -Version 1.2.0
dotnet add package WindowState --version 1.2.0
<PackageReference Include="WindowState" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WindowState --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

WindowState

Library to help save window state of WinForms windows. It will store Size, Location, FormWindowState (Normal, Minimized, Maximized), ColumnHeader.Width and SplitContainer.Distance. WindowStates can be put directly into settings.

Usage

Initialization

Anyway, initialize a WindowStates object somewhere. Can be put directly into Properties.Settings.Default, it will serialize automatically:

var settings = Properties.Settings.Default;

// Initialize WindowStates collection if null
if (settings.WindowStates == null)
{
    settings.WindowStates = new WindowStates();
}

Load

Use the WindowStates.Load(Form, throwErrorIfNotFound, restoreColumns = true, restoreSplitContainers = true) function:

settings.WindowStates.Restore(this, false);

Save

Use the WindowStates.Save(Form, saveColumns = true, saveSplitContainers = true) function:

settings.WindowStates.Save(this);

WindowState

Library to help save window state of WinForms windows. It will store Size, Location, FormWindowState (Normal, Minimized, Maximized), ColumnHeader.Width and SplitContainer.Distance. WindowStates can be put directly into settings.

Usage

Initialization

Anyway, initialize a WindowStates object somewhere. Can be put directly into Properties.Settings.Default, it will serialize automatically:

var settings = Properties.Settings.Default;

// Initialize WindowStates collection if null
if (settings.WindowStates == null)
{
    settings.WindowStates = new WindowStates();
}

Load

Use the WindowStates.Load(Form, throwErrorIfNotFound, restoreColumns = true, restoreSplitContainers = true) function:

settings.WindowStates.Restore(this, false);

Save

Use the WindowStates.Save(Form, saveColumns = true, saveSplitContainers = true) function:

settings.WindowStates.Save(this);

Release Notes

Add Save and Restore functions to WindowStates for easier access

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.0 840 10/17/2017
1.1.1 234 10/10/2017
1.1.0 247 10/10/2017
1.0.0 243 10/10/2017