Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

VB.Net: MDI

From Wiki

Jump to: navigation, search

you can make any form and mdichild of another.

Image:Formsmdichildren.jpg

Just create a form form1 with a button on it and a form named form2.

Then put this in the form1 click event.

  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         Me.IsMdiContainer = True
  5.         Dim _frm1 As New Form2
  6.         _frm1.MdiParent = Me
  7.         _frm1.Show()
  8.         Dim _frm2 As New Form2
  9.         _frm2.MdiParent = Me
  10.         _frm2.Show()
  11.         Dim _frm3 As New Form2
  12.         _frm3.MdiParent = Me
  13.         _frm3.Show()
  14.     End Sub
  15. End Class

Important bits are the me.IsMDiContainer which makes Form1 the parent form for the mdichildren.

and then the .MdiParent of all the mdiChildren to the form1. Look how the MDIChildren are below the other controls but in general you would not put controls on the mdiparent/container.

528 Rating: 1.3/5 (4 votes cast)