private void LogOutExecute() { try { string content = "Administrator has logged out."; LogIntoFile.getInstance().PrintActionIntoFile(content); Login login = new Login(); administrator.Close(); login.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }