2 Replies - 478 Views - Last Post: 22 January 2014 - 11:49 AM Rate Topic: -----

#1 WarMacheen  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 08-February 11

Load separate application into MDI

Posted 22 January 2014 - 10:16 AM

So, basically is it possible to load a separate solution or application into an MDI child window? Do I need to add the existing solution into the MDI? Would it be possible to load the application into the child form, form2 when it opens?



Public Class frmMdiMain



    Private Sub Window_Click(sender As Object, e As EventArgs)
        Dim Window As New MenuItem()
        ' Set this menu item to be used as an MDI list.
        window.MdiList = True
    End Sub



    Private Sub ToolStripMenuClose_Click(sender As Object, e As EventArgs) Handles ToolStripMenuClose.Click
        Me.Close()
    End Sub

    Private Sub ToolStripMenuCalc_Click(sender As Object, e As EventArgs) Handles ToolStripMenuCalc.Click
        Dim NewMDIChild As New form2

        NewMDIChild.MdiParent = Me

        NewMDIChild.Show()
    End Sub
End Class


Is This A Good Question/Topic? 0
  • +

Replies To: Load separate application into MDI

#2 thecoat  Icon User is offline

  • D.I.C Regular

Reputation: 108
  • View blog
  • Posts: 377
  • Joined: 07-December 13

Re: Load separate application into MDI

Posted 22 January 2014 - 11:22 AM

Quote

So, basically is it possible to load a separate solution or application into an MDI child window?


If you are talking about hosting a compiled exe I don't believe so. If you have the source for the application you wish to host you can change the project to a class library instead of a windows application, build it into a dll and add the dll to your hosting project, then create instances of the forms etc. A word of caution though, lets say in your sub app your have a form that has a button that creates and shows an instance of another form. If you load an instance of the first form as an MDI child and show it when you click it's button, the form it creates and displays will not be an MDI child.

Quote

Do I need to add the existing solution into the MDI?


Adding the sub app as a solution to your main MDI project would do essentially the same thing, you'd still need to change the project type to a library and add a reference to it.

Quote

Would it be possible to load the application into the child form, form2 when it opens?


I'm not sure if I quite get what you are asking, but if form2 is a mdi container inside an mdi container I believe it would be possible.

I am wondering if maybe your goals would be better served by creating a plugin interface because that sort of seems like the direction you are going.
Was This Post Helpful? 1
  • +
  • -

#3 WarMacheen  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 08-February 11

Re: Load separate application into MDI

Posted 22 January 2014 - 11:49 AM

I think I was going about this the wrong way but thanks for you answers. Instead of creating a new MDI application I simply added a new form, made it an MDI container and added controls to open the other forms. Now working on getting the other forms to open inside of the main parent MDI
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1