VB6.0问题请教,用变量作为窗体名 ,打开!

2024-12-03 18:00:18
推荐回答(1个)
回答(1):

不能,可以通过Select 语句
Select case ActiveMenu.Name
case "Form1
Form1.Show
Case "Form2
Form2.Show
End Select

或者事选把窗体添加进集合中
Dim col As new Collection
private sub Form_Load()
col.add Form1,"Form1"
col.add Form2,"Form2"
end sub
private sub 设置系统()
col.item(ActiveMenu.Name).Show
end sub