diff --git a/GUI/MainForm.Designer.cs b/GUI/MainForm.Designer.cs index 3f88cb0..3d2b7ec 100644 --- a/GUI/MainForm.Designer.cs +++ b/GUI/MainForm.Designer.cs @@ -467,6 +467,8 @@ namespace OpenHardwareMonitor.GUI { this.Text = "Open Hardware Monitor"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); this.Load += new System.EventHandler(this.MainForm_Load); + this.ResizeEnd += new System.EventHandler(this.MainForm_MoveOrResize); + this.Move += new System.EventHandler(this.MainForm_MoveOrResize); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); diff --git a/GUI/MainForm.cs b/GUI/MainForm.cs index a52700a..56f7d98 100644 --- a/GUI/MainForm.cs +++ b/GUI/MainForm.cs @@ -338,13 +338,6 @@ namespace OpenHardwareMonitor.GUI { } private void SaveConfiguration() { - if (WindowState != FormWindowState.Minimized) { - settings.SetValue("mainForm.Location.X", Bounds.X); - settings.SetValue("mainForm.Location.Y", Bounds.Y); - settings.SetValue("mainForm.Width", Bounds.Width); - settings.SetValue("mainForm.Height", Bounds.Height); - } - foreach (TreeColumn column in treeView.Columns) settings.SetValue("treeView.Columns." + column.Header + ".Width", column.Width); @@ -559,5 +552,14 @@ namespace OpenHardwareMonitor.GUI { sensor.ResetMax(); })); } + + private void MainForm_MoveOrResize(object sender, EventArgs e) { + if (WindowState != FormWindowState.Minimized) { + settings.SetValue("mainForm.Location.X", Bounds.X); + settings.SetValue("mainForm.Location.Y", Bounds.Y); + settings.SetValue("mainForm.Width", Bounds.Width); + settings.SetValue("mainForm.Height", Bounds.Height); + } + } } }