I have a C# WPF application which uses a WebBrowser class. I have overwritten the LoadComplete method. The question I have is this. This method is supposed to be triggered when the class has completed a load, but , when I put a breakpoint on this method, it is called before the class visually has compleded a load. Because of this, the htmldata is not complete. Any ideas?
Maybe there is a different method I should overide. LoadComplete might not be the best choice. Maybe there is something that is the same as a "display complete".
What do you mean when you say that "the htmldata is not complete"? You can access the mshtml.HTMLDocument object from the .Document property of the WebBrowser object in the LoadComplete event.
As for the "visuals", the page is rendered on the main UI thread. Since LoadComplete runs on the main UI thread (when the page has been loaded, but not yet displayed), the page will not display until LoadComplete exits ... unless you tell the thread's Dispatcher to process pending UI events (see DispatcherFrame in VS / C# Help).
Last Visit: 31-Dec-99 18:00 Last Update: 4-May-16 4:34