MDI Form Application

Source: Internet
Author: User

    1. MDI parent Form creation:

      Set the parent form property IsMdiContainer to True. It is important to note that not all forms can set this property to True, only the top-level form container is available as an MDI parent form.

      It is also important to note that the MDI parent form edges are system colors rather than user-set BackColor.

      It is also important to note that you must set the main form's Behavior property Mainmenustrip to the value you want, the system defaults to the first toolstripmenu as the value, if you are prepared to take the second memubar as the value, be sure to express, Otherwise, the result is that when the MDI child forms are maximized,

    1. MDI child forms are created:

      Create a form yourself and specify his MDI parent form as well as you can. This will become a multi-document interface.

      There's no technical difficulty with this.

      The hard part is how to set the form to be transparent, which is important in the appearance of the interface.

      In Vs08, you only need to select the menu item and then select the corresponding form in Mdiwindoelistitem, where you can set those forms to be transparent.

      There is also the ability to pin MDI child forms to some container, such as a panel, through code manipulation. This only needs to set his parentid.

    2. To determine the active MDI child form:

      The activemdichild property can get a subform with focus or a recently active subform.

    3. Sends data to the active MDI child window.

      Mirror

    4. Arranging MDI child windows:

      MDILayout several property settings in the enumeration type.

      This. LayoutMDI (System.Windows.Forms.MdiLayout.Cascade);

    5. The behavior of the MDI child forms control, such as when the icon is generated in the status bar of the main form, and the icon binds the click event. Icons automatically disappear when the form is closed. This is the most basic requirement. This is how you can manipulate the parent form in a subform, especially if you have a wide range of things to do. At this time, the. Net event response method model is instructive for us, and _click (object sender, System.EventArgs e) Directly references the event issuer and the event that is triggered in the event delegate. This makes it easy to manipulate or access the required properties and methods in the event's processing implementation body. We're here, too, when an MDI child form is created, you can keep a mirror of the main form in it, which allows you to achieve the results we need by accessing some of the main form's property methods, and avoids the complex communication mechanisms between forms. What I hate most is the communication between different classes, especially annoying is the access operation between different assemblies, the encapsulation and performance are met here, so people often have to think for a long time.

MDI child form Application tips:

The

MDI child form +pictruebox can implement some of the ListView functions, and the effect is better controlled and the interface is better beautified. It is important to note here that the MDI child form must specify the parent container and that Formstyle be set to none. But the effect is quite satisfactory. The advantage of this is that the development difficulty is reduced, the disadvantage is that the class increases.

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.