C # Close the display code in the MDI form

Source: Internet
Author: User

First:

Form room = new room (); // room is the new form name
For (INT x = 0; x <this. mdichil.pdf. length; X ++)
{
Form tempchild = (form) This. mdichil.pdf [x];
Tempchild. Close ();
}
Room. mdiparent = this;
Room. windowstate = formwindowstate. maximized;
Room. Show ();

 

Second:

// Query whether the form already exists by the form name. If yes, it is displayed. Otherwise, a new form is created.
If (this. checkchildfrmexist ("subjectsetting") = true)
{
Return;
}
Subjectsetting newfrm = new subjectsetting (); // subjectsetting is the new form name.
Newfrm. mdiparent = this;
Newfrm. Show ();

// ---------------------- query whether the MDI child form has a limit
private bool checkchildfrmist (string childfrmname)
{< br> foreach (Form childfrm in this. mdichil.pdf)
{< br> If (childfrm. name = childfrmname) // use the name of the child form to determine whether the child form exists. If so, activate the child form
{< br> If (childfrm. windowstate = formwindowstate. minimized)
childfrm. windowstate = formwindowstate. normal;
childfrm. activate ();
return true;
}< BR >}< br> return false;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.