Started by G_G, October 30, 2009, 05:49:55 pm
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.rmxos_closing); private void rmxos_closing(object sender, FormClosingEventArgs e) { if (runingintaskbar == false) { DialogResult result = MessageBox.Show("Do you want to keep running in the task bar?", "Closing", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { e.Cancel = true; minimize_to_tray(); } else { if (cfg_saved == false) { DialogResult result2 = MessageBox.Show("The configuration data has not been saved \r\n would you like to save now?", "CFG Not Saved!", MessageBoxButtons.YesNo); if (result2 == DialogResult.Yes) { save_data(); } } if (serverRunState == true) { RmxosProcess.Kill(); } } } else { if (cfg_saved == false) { DialogResult result2 = MessageBox.Show("The configuration data has not been saved \r\n would you like to save now?", "CFG Not Saved!", MessageBoxButtons.YesNo); if (result2 == DialogResult.Yes) { save_data(); } } if (serverRunState == true) { RmxosProcess.Kill(); } } }
Quote from: winkioI do not speak to bricks, either as individuals or in wall form.
Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.
Quote from: Blizzard on October 30, 2009, 06:33:09 pmThere's an event called FormClosing. Just define a method that is called at that moment and abort it. I can't remember how exactly I did it, but if you still have the Blizz-ABS Config source, I did it in there to make the saving before closing dialog possible.Ryex beat me to it. >8U@LF: That's for C in Unix. He's using C# in Windows. -_-