public void SaveForm(Form xform, string aSection)
{
if (xform == null) return;
if (xform.Name == "") return;
string section = xform.Name + aSection;
if (xform.WindowState != FormWindowState.Maximized)
{
this.WriteValue(section, "left", xform.Location.X);
this.WriteValue(section, "top", xform.Location.Y);
switch (xform.FormBorderStyle)
{
case FormBorderStyle.Sizable:
case FormBorderStyle.SizableToolWindow:
case FormBorderStyle.None:
this.WriteValue(section, "width", xform.Size.Width);
this.WriteValue(section, "height", xform.Size.Height);
break;
default:
this.DeleteValue(section, "width");
this.DeleteValue(section, "height");
break;
}
this.DeleteValue(section, "WindowState");
}
else
{
this.DeleteValue(section, "left");
this.DeleteValue(section, "top");
this.DeleteValue(section, "width");
this.DeleteValue(section, "height");
this.WriteValue(section, "WindowState",(int)xform.WindowState);
}
}