vb.net中如何把所有MDI子窗体的标题栏文字设置为 “子窗体i” (i 表示子窗体序号)?

2024-11-27 21:31:06
推荐回答(2个)
回答1:

增加一个模块
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

回答2:

在主窗体中设置静态变量