Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

No duplicate forms in MDI Parent (See related posts)

//This will ensure that no duplicate copies of a child form is created in an //MDI_Parent

            //"Display" is the form name
            foreach (Form childForm in this.MdiChildren)
            {
                if (childForm.GetType() == typeof(Display))
                {
                    childForm.Focus();
                    return;
                }
            }
            Display frmDisplay = new Display();
            frmDisplay.MdiParent = this;
            frmDisplay.Show();

You need to create an account or log in to post comments to this site.


Click here to browse all 4857 code snippets

Related Posts