谁说没有? 在工程中加一个窗体form2,在form1中的按钮中加以下代码试试: Private Sub Command1_Click() If Form2.Visible = False Then Form2.Show Else Form2.Hide End If End Sub
'判断窗体是否已经加载 strName窗体名 Public Function IsLoad(strName) As Boolean Dim intI As Integer For intI = 0 To Forms.Count - 1 If Forms(intI).Name = strName Then IsLoad = True Exit Function End If Next intI End Function '
在工程中加一个窗体form2,在form1中的按钮中加以下代码试试:
Private Sub Command1_Click()
If Form2.Visible = False Then
Form2.Show
Else
Form2.Hide
End If
End Sub
Public Function IsLoad(strName) As Boolean
Dim intI As Integer
For intI = 0 To Forms.Count - 1
If Forms(intI).Name = strName Then
IsLoad = True
Exit Function
End If
Next intI
End Function
'
visible比较好,谢了~~~~~~