例如你单击某个按钮,希望打开窗口2,其他窗口自动关闭:
For Each frm AS Winform.Form In Forms
if frm.Name = "窗口1" Then
frm.Open()
Else
frm.Close()
End if
Next