示例#1
0
 /**
  * This method defines
  */
 private void ManageTeams_FormClosing(object sender, FormClosingEventArgs e)
 {
     DialogResult result = MessageBox.Show("Do you really want to the main form?\n", "Confirmation",
         MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
     if (result == DialogResult.Yes)
     {
         var main = new MainForm();
         main.Show();
     }
     else
         e.Cancel = true;
 }
示例#2
0
 /**
  * This method defines what happens when the form is closing
  */
 private void AddSalesman_FormClosing(object sender, FormClosingEventArgs e)
 {
     DialogResult result = MessageBox.Show("Do you really want to exit to main form?", "Confirmation",
         MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
     if (result == DialogResult.Yes)
     {
         MainForm x = new MainForm();
         x.Show();
     }
     else
         e.Cancel = true;
 }