1、全局代码
<DllImport("user32.dll", EntryPoint := "SetParent")> _Public Function SetParent(hWndChild As Integer, hWndNewParent As Integer) As IntegerEnd Function
2、调用代码
forms("窗口2").openSetParent(forms("窗口2").Baseform.handle, e.Form.controls("panel1").basecontrol.Handle.ToInt32())