如题

解决方案 »

  1.   


    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
      

  2.   

    是否已经打开?还是是否已经载入?    Fg =0
        Dim frm As Form
        For Each frm In Forms
          if frm.Name = "Form1" Then
            Fg = 1
            If frm.Visible Then Fg = 2
          end if
        Next   Select Case Fg
       Case 0
             msgbox "没有载入!"
       Case 1
             msgbox "已经载入但隐藏!"
       Case 2
             msgbox "窗体是显示的哦!"
       End Select
      

  3.   

    对了,在
    if frm.Name = "Form1" Then
      ...
      ...
      Exit For       //这里加一句退出循环,因为找到了相应窗体嘛!
    End if
      

  4.   

    用 is nothing看行不行?我没试过