private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { Program.WriteSetting("WindowPosition", WindowPosition.SerializePosition(this)); }