void FrmOMS_FormClosed(object sender, FormClosedEventArgs e) { if (sender is frmMainImage) { frmMainImage = null; } }
private void btmain_Click(object sender, EventArgs e) { if (frmMainImage == null) { frmMainImage = new frmMainImage(); frmMainImage.FormClosed += new FormClosedEventHandler(FrmOMS_FormClosed); } if (frmMainImage == null) { frmMainImage = new frmMainImage(); } frmMainImage.Show(this.dockPanel2); }