Dim frm = forms("窗口1")
If frm.Opened Then
frm.Close
e.sender.Text = "打开"
Else
frm.Show
e.sender.Text = "关闭"
End If