Example #1
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     if (CloseCancel.ConfirmCloseCancel() == true)
     {
         e.Cancel = false;
     }
     else
     {
         e.Cancel = true;
     }
 }
Example #2
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            if (CloseCancel.ConfirmCloseCancel() == true)
            {
                e.Cancel = false;

                //Remove the tray icon from view and dispose of it
                trayIcon.Icon.Dispose();
                //Dispose of the tray icon object
                trayIcon.Dispose();
            }
            else
            {
                e.Cancel = true;
            }
        }