ARTICLE

MDI Forms in Vb.Net

Posted by Hirendra Sisodiya Articles | Windows Forms VB.NET July 08, 2010
This Article describe about MDI Forms with example in VB.NET.
Download Files:
 
Reader Level:


Basicaly MDI means Multiple Document Interface,With the help of mdi form we can view and work with several documents at once ( see picture1.1) .NET provides great support for creating and working with MDI applications such as  financial services organizations where the user needs to work with several documents at one time.

Mdiparent0.JPG

Picture 1.1


In .NET, we need only set the IsMdiContainer property of the form to True(see picture1.2). You create the child

forms at design time or at run time via code, and then set their MdiParent properties to reference a form  whose
IsMdiContainer  property is True. W
e  can change a  MDI parent/child  relationship  at  run time. It  also  allows  an
application to contain multiple MDI parent forms.


MdiParent1.JPG

Picture1.2

Example

 

Add new form and set the property IsMdiContainer to true and add this code

 

 Public Class Mdiparent

 

    Dim i As Integer = 1

    Private Sub mnuNewFrom_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles mnuNewFrom.Click

        Me.IsMdiContainer = True

        Dim MyChild As New System.Windows.Forms.Form()

        MyChild.MdiParent = Me

        MyChild.Show()

        MyChild.Text = "MDI Child" & i

        i = i + 1

    End Sub

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles MyBase.Load

        Me.Text = "MDIparent"

    End Sub

End Class

 

 

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor