Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. WebBrowser's Document Complete event

WebBrowser's Document Complete event

Scheduled Pinned Locked Moved C#
questionlearning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    profoundwhispers
    wrote on last edited by
    #1

    When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."

    H D 2 Replies Last reply
    0
    • P profoundwhispers

      When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."

      H Offline
      H Offline
      HiltonG
      wrote on last edited by
      #2

      Are you trying to detect when the page has loaded? try the body.onload event, but be aware that this will only fire when all of the content has downloaded (images etc.). You could also put a call to your function in tags at the bottom of the page if you want it to fire when the html is downloaded. Find my .Net blog at <a href="http://hiltong.blogspot.com">http://hiltong.blogspot.com</a></x-turndown>

      P 1 Reply Last reply
      0
      • P profoundwhispers

        When I process this event, it gets called multiple times per page. Why is this? How can I stop it, or should I use another event? Sammy "A good friend, is like a good book: the inside is better than the cover..."

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        It fires because the page your loading supports frames. The event will fire when the frame page is done loading (usually the one your navigated to), and it also fires for each subpage that the frame page loads. This behavior is by design. You can't turn it off. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        1 Reply Last reply
        0
        • H HiltonG

          Are you trying to detect when the page has loaded? try the body.onload event, but be aware that this will only fire when all of the content has downloaded (images etc.). You could also put a call to your function in tags at the bottom of the page if you want it to fire when the html is downloaded. Find my .Net blog at <a href="http://hiltong.blogspot.com">http://hiltong.blogspot.com</a></x-turndown>

          P Offline
          P Offline
          profoundwhispers
          wrote on last edited by
          #4

          body.onload is not exposed via the mshtml interface. I have an AxWebBrowser component inside my Windows Forms project. That's where the event is hooked. Sammy "A good friend, is like a good book: the inside is better than the cover..."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups