private void Bt_Logout_Click(object sender, EventArgs e) { this.Hide(); login_form fl = new login_form(); fl.Show(); }
private void Frame_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dialog = MessageBox.Show("Do you want to save your file before closing the program?", "Exit", MessageBoxButtons.YesNoCancel); if (dialog == DialogResult.Yes) { dataMng.Write2File(); } if (dialog == DialogResult.Cancel) { e.Cancel = true; return; } login_form log = new login_form(); log.Show(); }