C # develop the winform interface framework,
First, create a "Windows application". The default "Form1" file is changed to the form of MainForm as the main form of the program. Drag three widgets from the control box: MenuStrip, ToolStrip, and StatusStrip. You can modify the Dock attribute of ToolStrip to set the TOOL location, which is similar to fram's content. Set "IsMdiContainer" of MainForm to true, which means it can accommodate multiple Form objects.
Next we can create a batch of forms, each of which implements different functions. These Form "FormBorderStyle" must be set to None, so that the buttons to maximize and minimize will be hidden. In addition, set AutoSize to true to enable the Form to adapt the size of the main Form. Set "ShowInTaskbar" to false.
In the Load events of these child forms, add a function and write the following sentence:
This. Dock = DockStyle. Fill;
This is to fill the main form.
Next, add some buttons in the ToolStrip control of the main form, and then write the functions for clicking these buttons. In the function, you first need to generate the child Form instance, and then add a key sentence:
Form_child.MdiParent = this;
The Code indicates that MainForm contains the subform.
When you add multiple buttons in ToolStrip, You need to determine if the corresponding child Form has an instance when clicking the button. If yes, use form_child.Show () the child Form is displayed.