Exemplo n.º 1
0
 static public void CloseResultForm()
 {
     try
     {
         //Test if the form the user is wanting to close is open
         if (ResultFormOpen)
         {
             //Form is open
             //Dispose of the form
             ResultForm.Dispose();
             //Set the Result Form Open boolean to false to ensure opening of the form again
             ResultFormOpen = false;
         }
         else
         {
             //Form is already closed
             MessageBox.Show("The Result screen is already closed!", "Result screen already closed", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler.ThrowException(ex);
     }
 }