Public 实例化 As Boolean
Private Sub Form_Load()
实例化 = True
End SubPrivate Sub Form_Unload(Cancel As Integer)
实例化 = False
End SubIf Form1.实例化 Then MsgBox "已经实例化" Else MsgBox "还没实例化"

解决方案 »

  1.   

    不知道除了用 handsomge所说的变量外,有没有其他办法。比如有没有象isnull,isobject这样的函数判断是否已经实例化。
      

  2.   

    'object=nothingif form2=nothing then 
      msgbox "No Form2"
    else
      msgbox "Form2 Loaded"
    end if
      

  3.   

    Dim a As Form
    For Each a In Forms
       If a.Name = Form1.Name Then MsgBox "已经加载"
    Next
      

  4.   

    jamesfay:
    我用你的方法不行,if form2=nothing then 在运行时报错,用if form2 is nothing then 又不起作用。
      
      

  5.   

    oceanmap() 的可行!handsomge(和尚) 的当窗口没实例化时执行要报错的。
      

  6.   

    dim frmTemp as form 
    for each frmTemp in forms
      msgbox frmTemp.name
    next