views:

60

answers:

1

I have a page that refreshes every 20 seconds and I need to know when it is done refreshing, the DocumentCompleted event does not fire when you refresh for some reason. Any ideas?

+2  A: 

You could try waiting until the WebBrowser.ReadyState property is set to complete. Alternatively, instead of Refresh()ing you could Navigate() to the current URL, which would cause the DocumentCompleted event to fire as you want.

theprise
But Navigate() does not get the new page, it simply gets it from the cache if it has loaded it before. Also what is the wait function in Visual Basic?
Bubby4j
@Bubby: Try something similar to while WebBrowser.ReadyState != WebBrowserReadyState.Complete System.Threading.Thread.Sleep(1000)
theprise
Does sleep not halt the thread? Other things will need to run.
Bubby4j