Recently, a netizen asked me this question, I went online search, the results are very disappointed. There are several help posts on the csdn. There was no clear answer at the end of the view.
Here I found on the Internet API function SetParent (), and the online error has been changed, and gave a simple example code.
Readers can test themselves:
Public Class Form1 ' octopus brother, qq:3107073263 Group: 309816713 ' If you have any questions or good suggestions please contact me. Everybody progress together ' Declare the SetParent function. This is an API function Declare functions SetParent Lib "user32" Alias "SetParent" (ByVal hwndchild as INTPTR, ByVal hwndnewparent as INTPTR) as Long Private Sub Form1_Load (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Mybase.loa D me.ismdicontainer = True ' Sets Form1 to the parent window container End sub Private Sub button1_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button1.Click ' Form1 is the parent window, Form2 is a child window SetParent (Form2.handle, Me.handle) form2.show () End Sub Private Sub button2_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles button2.click
setparent (Form3.handle, Me.handle) form3.show () End subend Class
Effect:
Vb. NET Octopus Brother Production-How to troubleshoot an MDI child window that is covered by a control in the parent window