?
Solved

VB 2005 Embedding a form in another form

Posted on 2006-11-16
9
Medium Priority
?
193 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:Murray Brown
[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 400 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:Murray Brown
ID: 17955598
Thanks iboutchkine and newYuppie.

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

Thanks
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 13

Accepted Solution

by:
newyuppie earned 1600 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:Murray Brown
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:Murray Brown
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 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