Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

force to open all forms inside MDI

Status
Not open for further replies.

igor22

Programmer
Sep 18, 2003
50
US
Hi,

I am consolidating a number of stand-alone windows application under one MDI application. The development of those stand-alone applications is separated in each different project.

Is there a way to force any forms that open inside those applications to be open inside the main MDI form (if the application is callled from the MDI)?

Thanks,

Igor
 
You need to set the MdiParent property like:

dim f as new myproject.formname
f.mdiparent = me
f.show()

Note that this code should be in the mdi class (object form), so the keyword 'Me' points to that form
 
it's a good solution thanks.
What about forms the get open from myproject.formname?
How can I make sure they will open inside the MDI?
 
Hi

you set the mdiparent property. VB.NET is not like vb6. In vb6 we used to 'mark' a form as child form. Now in .NET, we treat MDI forms as 'clothes'. In other words, you have your regural form and by setting the .MdiParent property, you simply select which mdi form to 'wear'.
Am i clear?

This also means that you may not have shown the mdi form yet. Look at the following:

Dim f as new form4 ' the child
dim mdi as new form25 ' this will be the parent
mdi.ismdicontainer=true ' this form can host other forms
f.mdiparent = mdi ' ..set the property
f.show()

Note that i show only the 'f' (child) form. But I have set it to have a parent. So, the mdiparent will be shown too.


Hope these help.
Post if you need to ask again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top