Solved

VB 2005 Embedding a form in another form

Posted on 2006-11-16
9
189 Views
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
form.

Is this possible?


Thanks
0
Comment
Question by:murbro
  • 5
  • 3
9 Comments
 
LVL 28

Assisted Solution

by:iboutchkine
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
        Me.Controls.Add(f)
'f is in coordinates of form1
        f.Left = 0
        f.Top = 0
        f.Show()
        f.BringToFront()
    End Sub
0
 
LVL 13

Expert Comment

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

Author Comment

by:murbro
ID: 17955598
Thanks iboutchkine and newYuppie.

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

Thanks
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 13

Accepted Solution

by:
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
frm.show
0
 
LVL 13

Expert Comment

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

Author Comment

by:murbro
ID: 17955651
Thanks both very much for the help
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17955660
this MSDN link has more information: http://msdn2.microsoft.com/en-us/library/7aw8zc76(VS.80).aspx
(always try to search in the MSDN help you can find what you need 99% of the times)
NY
0
 

Author Comment

by:murbro
ID: 17955674
Thanks very much for the extensive help newyuppie
0
 
LVL 13

Expert Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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