VB 2005 Embedding a form in another form

Posted on 2006-11-16
Last Modified: 2010-08-05
I have a form with several built-in dialogs etc that I want to be used as one of the tab pages in another

Is this possible?

Question by:Murray Brown
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
LVL 28

Assisted Solution

iboutchkine earned 100 total points
ID: 17955552
you can add this form to the another like that
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim f As New Form2()
        f.TopLevel = False
'f is in coordinates of form1
        f.Left = 0
        f.Top = 0
    End Sub
LVL 13

Expert Comment

ID: 17955558
a better design would be to set a parent MDI and show the forms as MDI children

Author Comment

by:Murray Brown
ID: 17955598
Thanks iboutchkine and newYuppie.

Would it be possible to elaborate a little on what newyuppie said.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 13

Accepted Solution

newyuppie earned 400 total points
ID: 17955627
select one form to be the parent, and set its MDIContainer property to TRUE in the designer. notice that the background color of parent form will turn grayish.

no when you need to show a child form it will show on the gray part, called the Client area. call to show like this from the parent form:

dim frm as New Form2
frm.MdiParent = me
LVL 13

Expert Comment

ID: 17955633
sorry the property is called IsMDIContainer, not MDIContainer (too early here!)

Author Comment

by:Murray Brown
ID: 17955651
Thanks both very much for the help
LVL 13

Expert Comment

ID: 17955660
this MSDN link has more information:
(always try to search in the MSDN help you can find what you need 99% of the times)

Author Comment

by:Murray Brown
ID: 17955674
Thanks very much for the extensive help newyuppie
LVL 13

Expert Comment

ID: 17955694
thank you for the points. hope you dont have any problems applying this.

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question