protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (m_Capture != null) { m_Capture.Dispose(); } if (m_VisualOdometer != null) { m_VisualOdometer.Dispose(); } if (this.WindowState != FormWindowState.Minimized) { Settings.Default.Size = this.Size; Settings.Default.Location = this.Location; } Settings.Default.Save(); }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); if (m_Capture != null) { m_Capture.Dispose(); } if (m_VisualOdometer != null) { m_VisualOdometer.Dispose(); } // If the MainForm is not minimized, save the current Size and // location to the settings file. Otherwise, the existing values // in the settings file will not change... if (this.WindowState != FormWindowState.Minimized) { Settings.Default.Size = this.Size; Settings.Default.Location = this.Location; } Settings.Default.Save(); }