public static FrmTableInfo Creat() { if (_frm == null) { _frm = new FrmTableInfo(); } return(_frm); }
private void menuTableInfo_Click(object sender, EventArgs e) { FrmTableInfo frmTableInfo = FrmTableInfo.Creat(); frmTableInfo.RefreshMain += LoadHallInfo; frmTableInfo.Show(); frmTableInfo.Focus(); }
private void FrmTableInfo_FormClosing(object sender, FormClosingEventArgs e) { //与单例保持一致 //出现这种代码的原因:Form的close()会释放当前窗体对象 _frm = null; }