CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    306

    OnDocumentCompleted went through 6 cycles?

    I made a fun little program that searches through threads, but it went through the function six times, I isolated the problem and I found out that it was this.

    Code:
    private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    Is there another way to get around this?

    For more explanation:

    If i put the above code and then I type

    Code:
    textbox1.append("hello");
    when it's done, it will have at least six "Hello" 's in it.

  2. #2
    Join Date
    Jul 2003
    Location
    Bali, Indonesia
    Posts
    103

    Re: OnDocumentCompleted went through 6 cycles?

    Debug how many time you attach the handler..
    I'm sure you attach it more than once

  3. #3
    Join Date
    May 2006
    Posts
    306

    Re: OnDocumentCompleted went through 6 cycles?

    No, i don't think so, I just double clicked the webbrowser, and it generated the code, nothing else.

    I think I'll just trying my code when it's done navigating.


    On sites like google, it's fine, but on sites with asp and it loads multiple pages, it fires the block "document loaded" for each page loaded and not when the whole document is complete.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured