form窗体如果已打开,能否从相关属性中读出? 如果有的话是什么属性?谢谢!!

解决方案 »

  1.   

    Not(Form1 Is Nothing)
    或者 Form1.Visible = True
    或者在 Forms 集合里面找。
      

  2.   

    Visible 属性是判断窗体是否可见
     
      

  3.   

    最合理的,在打開的Forms集合中找吧。
      

  4.   

    这样遍历Forms集合:
    dim f as form
    for each f in forms
        if f is Form1 then ' 设Form1是要被查找的窗体
             msgbox "Form1 已经打开了!"
            exit for
        end if
    next
      

  5.   

    dim f as form
    for each f in forms
        if f is Form1 then ' 设Form1是要被查找的窗体
             msgbox "Form1 已经打开了!"
            exit for
        end if
    next