Dotnet WinForm FAQ2 (post) (programming skills)-Windows development-. NET tutorial-

Source: Internet
Author: User

9. How to create an MDI form
1. Create a new Windows Application project
2. Add two forms: Form1 and Form2.
3. Set the IsMdiContainer attribute of Form1 to True. Make it an MDI main form.
4. Add a RichTextBox Control to Form2 and set the Dock to Fill.
5. drag a MainMenu in the Tools form to the form Form1, and create a menu File | Windows | Help. The File contains the New and Exit menu items; windows includes Cascade and Horizontal.
6. Set the MdiList attribute of the Windows menu item to True, so that each MDI subwindow is automatically added under the Windows menu item.
7. Double-click the New menu item and add the following code:
Private void menuNew_Click (object sender, System. EventArgs e) <? Xml: namespace prefix = o ns = "urn: schemas-microsoft-com: office"/>
{
Form2 NewMdiChild;
NewMdiChild = new Form2 ();
NewMdiChild. MdiParent = this;
NewMdiChild. Show ();

}
8. Add the following code to Windows Cascade and other menu items:
Private void menuWindowCasca_Click (object sender, System. EventArgs e)
{
This. LayoutMdi (MdiLayout. Cascade );

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.