コード例 #1
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     if (CloseCancel.ConfirmCloseCancel() == true)
     {
         e.Cancel = false;
     }
     else
     {
         e.Cancel = true;
     }
 }
コード例 #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;
            }
        }