Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Make Parent Child Relationship between Forms Using IsMdiContainer Property of the Form

Author: DevASP
Download Source Code : 313_mdi.zip

If you want that your all forms remain inside a main Parent Form then you should use this MDI form Relationship. This is very Simple in Visual Studio.net

In this simple example you just create two forms one form is the main form named form1 and other one is child form named child. Just change the property of main form to make it the parent form in the load event and call child one from

 

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.IsMdiContainer = True

        Dim frm As New child

        frm.MdiParent = Me

        frm.Show()

End Sub

In these statements first statement

Me.IsMdiContainer = True

make form1 parent form. Second statement

Dim frm As New child

create the object of the child form by which we can call that form. Third statement

frm.MdiParent = Me

make child form child of the form1 and the last statement

frm.Show()

call the child form.

NOTE:

 

This is a important thing that one form cannot be child and a parent at the same time.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< How to make a Round Shape Form

Disclaimer - Privacy
© 2002-2017 DevASP.net