你窗口A放入一个tabcontrol控件,然后弄一个按钮,写下面代码
Dim tab As WinForm.TabControl = e.form.Controls("TabControl1")
Dim Name As String = "窗口B"
tab.TabPages.Add(e.sender.name,e.sender.name)
Dim pb = tab.BaseControl
Forms(Name).OPEN(-1000,-1500)
Forms(Name).BaseForm.TopLevel = False
Forms(Name).BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Forms(Name).BaseForm.Dock = System.Windows.Forms.DockStyle.Fill
PB.TabPages(e.sender.name).Controls.Clear
PB.TabPages(e.sender.name).Controls.add(Forms(Name).BaseForm)
tab.SelectedPage = tab.TabPages(e.sender.name)