-
Jun 24th, 2021, 07:51 PM
#1
Thread Starter
Addicted Member
[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?
-
Jun 25th, 2021, 12:31 AM
#2
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.
-
Jul 11th, 2021, 10:55 PM
#3
Thread Starter
Addicted Member
Re: [Vb.net] Turn .EXE to child into a form
Originally Posted by jmcilhinney
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|