How to auto save all properties winforms when closed and auto load all properties winforms when load ? C#
using System;
using System.Collections.Generic;
us
I'm not aware of any automatic method built into the Form
base class, but adding it yourself isn't hard.
You could tap the window load and close events to cache off all relevant properties to a backing store and then reload them later.
Register an event handler to the Form.Load
and Form.Closing
event handlers. When Form.Closing
occurs, save the forms state to a file or database. When Form.Load
occurs, check to see if a saved state is present and if so, reload the from from the saved state.