Results 1 to 3 of 3

Thread: [RESOLVED] [Vb.net] Turn .EXE to child into a form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2021
    Posts
    166

    Resolved [RESOLVED] [Vb.net] Turn .EXE to child into a form

    I created a parent mdi form that has an open files button when I click on it I can select another program or form to be opened within the parent mdi content.

    My goal is to create another project so that my form is always an mdi child so when I compile this second program, I can call it in my program that opens mdi child.

    But I tried to make my other form mdi child and compile making it child but the other form being .EXE it does not become child is there any way of another .exe made in .netcore is configured to be mdi child?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: [Vb.net] Turn .EXE to child into a form

    Hosting your own forms and hosting other applications are completely different things, so one is not relevant to the other. If you want to host a window from another application then you need to use the SetParent API function. Search for that and you should find plenty of examples.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2021
    Posts
    166

    Re: [Vb.net] Turn .EXE to child into a form

    Quote Originally Posted by jmcilhinney View Post
    Hosting your own forms and hosting other applications are completely different things, so one is not relevant to the other. If you want to host a window from another application then you need to use the SetParent API function. Search for that and you should find plenty of examples.
    If I create my vb program. setting to SetTopLevel(false) Compile to .EXE and call in another form (Project Uncompiled) my exe will be called by my form in the uncompiled project.

    As for SetParent it is not very effective, but it is possible to index thousands of .EXE apps from .net itself if they are SetTopLevel(false)


    Code:
    Thanks to everyone I solved it in a simpler way without creating a new control, well it's easy:
    
    I created a form 2 by visual studio, then opened form2.Designer.vb
    
    and went to the following line of code:
    
       Me.ResumeLayout(False)
    
    and above it I inserted the following line:
        Me.SetTopLevel(False)
             Me.ResumeLayout(False)
    
    after that I put the following result:
    
        Me.SetTopLevel(False)
             Me.ResumeLayout(False)
    Me.Show()
    
    So returning to form1 instead of calling an mdi child I put the following:
    
      Private Sub Form1_Load(sender As Object, and As EventArgs) Handles MyBase.Load
    
    'this call form two as MDI child (control)
    Me.controls.add(form2)
    form2.show()
    End sub

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width