CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2011
    Posts
    69

    How to make the webbrowser wait before completing another action?

    I have a list box and for each item I want it to visit a different site. Whats happening is it visits the first site (first item in the list) but then just iterates down the list not completing it for the other items.

    How can I make it wait for the other to complete?

  2. #2
    Join Date
    Sep 2011
    Posts
    69

    Re: How to make the webbrowser wait before completing another action?

    Bump

  3. #3
    Join Date
    Sep 2000
    Location
    FL
    Posts
    1,452

    Re: How to make the webbrowser wait before completing another action?

    Code??

  4. #4
    Join Date
    Sep 2011
    Posts
    69

    Re: How to make the webbrowser wait before completing another action?

    I think I solved the issue...sort of. I added Application.DoEvents and it makes the listbox wait for it to load the site and fill data to the forms but how do I make the listbox iteration wait for user input before moving on?

  5. #5
    Join Date
    Jun 2008
    Posts
    6

    Re: How to make the webbrowser wait before completing another action?

    You can add Thread.Sleep( seconds ) and mention the time duration ( generally in milliseconds ) for the active thread/application to wait and they add some code to prompt the user at the end of each and every iteration

  6. #6
    Join Date
    Sep 2011
    Posts
    69

    Re: How to make the webbrowser wait before completing another action?

    Quick question won't Thread.Sleep freeze the GUI? Will it stop a page from loading in the background?

    Also I fixed the issue completely by adding an if/then statement but now my issue is my documentcompleted isn't letting the page load. Is it cause I am loading a page directly in the documentcompleted event?

    I added a while loop saying if the page has loaded to perform the code but its not working that great...

    Any suggestions?

Tags for this Thread

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