private void btnRegister_Click(object sender, EventArgs e) { if (registerForm == null) { if (CurrentUser.User == null) { registerForm = new registerForm(); //registerForm.MdiParent = mainForm.Instance; registerForm.StartPosition = FormStartPosition.CenterScreen; registerForm.FormClosed += RegisterForm_FormClosed; this.Hide(); registerForm.Show(); } else { registerForm.Activate(); } } }
private void RegisterForm_FormClosed(object sender, FormClosedEventArgs e) { registerForm.Dispose(); registerForm = null; this.Show(); }