Solved

VB 2005 Embedding a form in another form

Posted on 2006-11-16
9
191 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
[X]
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
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.

730 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