标签:
private void companyToolStripMenuItem1_Click(object sender, EventArgs e) { Master.CompanyMasterForm cmpnymasterform = null; bool isFormOpen = IsAlreadyOpen(typeof(Master.CompanyMasterForm)); if (isFormOpen == false) { cmpnymasterform = new Master.CompanyMasterForm(); cmpnymasterform.StartPosition = FormStartPosition.CenterScreen; cmpnymasterform.MdiParent = this; cmpnymasterform.Show(); } } private bool IsAlreadyOpen(Type formType) { bool isOpen = false; foreach (Form f in Application.OpenForms) { if (f.GetType() == formType) { f.BringToFront(); f.WindowState = FormWindowState.Normal; isOpen = true; } } return isOpen; }
标签:
原文地址:http://www.cnblogs.com/eastson/p/4205142.html