C # How many WinForm MDI Form Control codes are written,

Source: Internet
Author: User

C # How many WinForm MDI Form Control codes are written,

  

/// <Summary> /// function: in the MDI program, set the main Form size to the display workspace size. /// </summary> /// <param name = "MainForm"> main Form instance </param> public static void SetMainFormSize (Form mainForm) {MainForm. location = new Point (0, 0); MainForm. width = Screen. primaryScreen. workingArea. width; MainForm. height = Screen. primaryScreen. workingArea. height ;}

**************************************** *************

/// <Summary> /// function: in the MDI program, set the child form size to the workspace size of the parent form /// </summary> /// <param name = "MdiForm"> child form instance </param> public static void SetMdiChildSize (Form MdiForm) {MdiForm. location = new Point (0, 0); MdiForm. width = MdiForm. parent. clientSize. width; MdiForm. height = MdiForm. parent. clientSize. height ;}

**************************************** *************

/// <Summary> /// function: Disable all opened MDI child forms // </summary> /// <param name = "MainForm"> parameter: parent Form </param> public static void CloseAllMdiForms (Form MainForm) {if (MainForm. mdichil.pdf. length <= 0) {return;} else {foreach (Form SubForm in MainForm. mdichilform) {SubForm. close ();}}}

**************************************** *************

/// <Summary> /// function: checks the status change of the Mdi subform, restore the default state when the sub-form is minimized or maximized /// </summary> /// <param name = "MdiForm"> sub-form instance </param> public static void SetMdiFormState (form MdiForm) {if (MdiForm = null) {return;} else if (MdiForm. windowState = FormWindowState. minimized) | (MdiForm. windowState = FormWindowState. maximized) {MdiForm. windowState = FormWindowState. normal ;}}

 

Related Article

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.