본문 바로가기

c#

c# 폼의 중복실행 방지

        private void ConfigToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form frm in Application.OpenForms)
            {
                if (frm.Name == "frmConfig")
frm.Activate(); return; } frmConfig configForm = new frmConfig(); configForm.Show(); }