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

About this user

Dave http://pedotnet.blogspot.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

No duplicate forms in MDI Parent

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

   1  
   2              //"Display" is the form name
   3              foreach (Form childForm in this.MdiChildren)
   4              {
   5                  if (childForm.GetType() == typeof(Display))
   6                  {
   7                      childForm.Focus();
   8                      return;
   9                  }
  10              }
  11              Display frmDisplay = new Display();
  12              frmDisplay.MdiParent = this;
  13              frmDisplay.Show();
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS