title: How to auto save and auto load all properties in winforms C#?
body: <p>How to auto save all properties winforms when closed and  auto load all properties winforms when load ? C#</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Text;
  using System.Windows.Forms;
  using System.IO;
  namespace SControl
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              for (int i = 0; i &lt; Controls.Count; i++)
              {
                  System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(Controls[i]));
                  Stream stream = File.Open("test.xml", FileMode.Create);
                  x.Serialize(stream, Controls[i]);
              }
          }
      }
  }
  </code></pre>