Do you provide a warning before the program exits?
Last updated by Brady Stroud [SSW] 8 months ago.See historyA product should not close without providing a warning. We use the following message box to warn the user before closing a program:
private void OnExit(object sender)
{
EventHandler handler = ExitRequest;
if (handler!= null )
{
handler(sender, EventArgs.Empty);
return;
}
string closeTitle = string.Format("Exiting{0}", Application.ProductName);
string closeMessage = string.Format("Are you sure you want to exit {0}", Application.ProductName);
DialogResult result = MessageBox.Show(closeMessage, closeTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
Application.Exit();
}
}
We have an example of this in the SSW .NET Toolkit.