如何判断VB某一个窗体是否Load入内存或已show

解决方案 »

  1.   

    Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
      

  2.   

    dim XX as form
    for each XX in forms
      if XX.name=TargetFormName then msgbox "Loaded"
    next
      

  3.   

    function frmcheck(frmname as string) as boolen
             dim frm as form
              
             for each frm in forms
                  if ucase$(frm.name)=ucase$(frmanme) then
                      frmcheck=true
                      exit for
                  end if
             next 
    end function
      

  4.   

    是你自己程序的窗体吗?如果是还用判断吗,它什么时候load还不是你说了算吗?在模块里放一个public变量,作为标志,在form_load里置值