How to arrange The display of Multiple MDI Child Forms In VB.NET

In this article you learn how to use LayoutMdi method with MdiLayout enumeration for the Mdi parent form.
  • 9003
 

Introduction

As my previous article helps you to learn Create procedures. Now I am going to tell about the working of LayoutMdi Method. The LayoutMdi Method is used wiyh MdiLayout enumeration to rearrange the child forms in an MDI parent form. 

Get to Work

With the help of below given example, you can learn how to use LayoutMdi method with MdiLayout enumeration for the Mdi parent form and you have to use enumeration in the code of click event of the Cascade Windows menu item.
 

Step to Create and Implement MDI Child Form

  1. Assumes there is an MDI parent form having MenuStrip with option New, Window and Close in New menu, main form contain one Child form having a RichTexBox. For details, see Creating an MDI Form.
     
    1.gif

     

  2. Add one More control in Main form MenuStrip As Cascade Windows.

      2.gif
     
     

  3. Double click on Cascade windows control and write this Code.

    Private Sub CascadeWindowsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles       CascadeWindowsToolStripMenuItem.Click
    Me.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade)
    End Sub

     

  4. Debug the application and click on New button two times than two MDI Child form with RichTextBox will open. Now by using Cascade Windows control in the Main Menu you can Arrange All the Opened Mdi Child form in cascade mode.

      3.gif

      4.gif

Summary

In this article, we discussed how to arrange MDI Child Form in Cascading mode using Visual Studio 2010 and VB.NET

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.