Solved

VB 2005 Embedding a form in another form

Posted on 2006-11-16
9
187 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now