- 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,
- 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.
- To determine the active MDI child form:
The activemdichild property can get a subform with focus or a recently active subform.
- Sends data to the active MDI child window.
Mirror
- Arranging MDI child windows:
MDILayout several property settings in the enumeration type.
This. LayoutMDI (System.Windows.Forms.MdiLayout.Cascade);
- 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.