/// <summary> /// 得到一个窗体对象,如果被销毁,则另创 /// </summary> /// <returns>返回RegisterForm对象</returns> public static RegisterForm getRegisterForm() { if (rform.IsDisposed) // 如果窗体被销毁,直接另创一个窗体 { rform = new RegisterForm(); } return(rform); }
/// <summary> /// 点击注册,弹出注册框 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnReg_Click(object sender, EventArgs e) { RegisterForm rForm = RegisterForm.getRegisterForm(); rForm.Show(); }