winform 只允许显示一个子窗体

 bool bol = false;
            foreach (Form fm in Application.OpenForms)
            {
                if (fm is fmSales)
                { bol = true;fm.Activate (); break; }
            }
            if (!bol)
                new fmSales().Show();

 

posted @ 2013-09-17 14:30  JasonGu0  阅读(356)  评论(0编辑  收藏  举报