增加一个模块
module mgrmdi
public mdifather as form=nothing
public mdison as integer=1
public sub OpenNewSon(byref SonForm as form)
___sonform.mdiparent=mdifather
___sonform.text=string.format("子窗体{0}",mdison.tostring)
___sonform.show
___mdison+=1
end module
在mdi父窗体启动时
sub form_load()
mdifather=me
end sub
加载子窗体使用
sub button1_click()
dim newform as new formson
OpenNewSon(newform)
end sub
在主窗体中设置静态变量