private void Settings_FormClosing(object sender, FormClosingEventArgs e) { Program.INIGUI.Write(this.Name, "Location", this.Location); Program.INIGUI.Write(this.Name, "Size", this.Size); var ini = new CoViD.INI(udRadius, udPeople, udSteps, udTicks, udIsolation); if (ini != this.INI) { DialogResult result = MessageBox.Show("Settings are changed. Saving the changes will clear all the diagrams and restart the elaboration.\nWant you save changes?", "Data changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); var data = result.IsYes() ? ini : INI; Program.INICoViD.Write(data); } }