被该问题困扰很久,很多有iframe框架组成的页面都不好判断其完全加载完成,特别是包含了iframe富文本编辑器的网页,再次希望大神们给出您宝贵的意见及思绪…

解决方案 »

  1.   

    webpage.WebBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
    webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
    ……//自己写你想实现的}
      

  2.   

    webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
    if(e.Url!="自己想转到的URL")
    return;……//自己写你想实现的}
    或者用contains
      

  3.   

    浏览器控件对象.StatusText==“完成"
      

  4.   

    下述答案来自一个非计算机专业的VB爱好者,算是给CSDN的见面礼。
    Public Function IsHPOpen(ByVal HP As String) As Boolean
     IsHPOpen = False
        Dim sWind     As ShellWindows
    Dim IE        As InternetExplorer
    Set sWind = New ShellWindows
    TT = Now()
    LINE1: Do While DateAdd("S", 20, TT) > Now()    '等待20秒
      For Each IE In sWind
        If InStr(IE.LocationURL, HP) <> 0 Then
        
          N = IE.Document.Frames.Length - 1
            If N > -1 Then
               For I = 0 To N
                If UCase(IE.Document.Frames(I).Document.ReadyState) <> "COMPLETE" Then
                  GoTo LINE1
                End If
               If I = N And UCase(IE.Document.Frames(I).Document.ReadyState) = "COMPLETE" Then
                 GoTo LINE2
               End If
              Next
            End If
            
            
    LINE2: M = IE.Document.All.Length - 1
             If M > -1 Then
               If UCase(IE.Document.ReadyState) = "COMPLETE" Then
                 IsHPOpen = True
                    Exit Function
               End If
             End If
               
               
         End If
      Next
    Loop
    End Function
      

  5.   

    http://club.excelhome.net/forum.php?mod=redirect&goto=findpost&ptid=815805&pid=6110079看这个原理
      

  6.   


    十九楼不是写了 .Document.Frames(I).Document.ReadyState 么。
      

  7.   

    您好,这个是针对iframe框架的,但网页中有些js执行方法,DocumentCompleted事件无法捕捉到,还是不能准确的判断网页正在加载完成…