WebBrowser control questions
-
Hello, When playing with the webbrowser control I realized two things: - If I call Navigate("about:blank"...) and the line after Navigate("http://www.test.com/"...), the first call 'about:blank' never fire a beforeNavigate2,NavigateComplete and DocumentComplete events and the webbrowser is not loaded with the blank page. Of course the second call properly load the page and all events are fired. How is it possible to make sure that both Navigate calls are going to work ? - When I use Webbrowser.Stop() it seems that it doesn't prevent the browser to continue loading parts of the page and fire Before,Complete & so on events. Maybe the problem is related to the other because I try to call first Webbrowser.Stop() and I call Navigate ("about:blank"...) the line after to empty the Webbrowser. I'm not sure the WebBrowser.Stop() is executed but the second call "about:blank" fire before,complete & so on events and works. How is it possible to make that the Webbrowser.Stop() call works ? And if Stop() doesn't do it, how is it possible to prevent the load of parts of the page ? Any help will be greatly welcome, R. LOPES Just programmer.
-
Hello, When playing with the webbrowser control I realized two things: - If I call Navigate("about:blank"...) and the line after Navigate("http://www.test.com/"...), the first call 'about:blank' never fire a beforeNavigate2,NavigateComplete and DocumentComplete events and the webbrowser is not loaded with the blank page. Of course the second call properly load the page and all events are fired. How is it possible to make sure that both Navigate calls are going to work ? - When I use Webbrowser.Stop() it seems that it doesn't prevent the browser to continue loading parts of the page and fire Before,Complete & so on events. Maybe the problem is related to the other because I try to call first Webbrowser.Stop() and I call Navigate ("about:blank"...) the line after to empty the Webbrowser. I'm not sure the WebBrowser.Stop() is executed but the second call "about:blank" fire before,complete & so on events and works. How is it possible to make that the Webbrowser.Stop() call works ? And if Stop() doesn't do it, how is it possible to prevent the load of parts of the page ? Any help will be greatly welcome, R. LOPES Just programmer.
Because of the multi-threaded nature of IE, the WebBrowser.Stop() method doesn't work well. Multiple framed pages only worsen the situation. In fact, the navigation toolbar does not work as soon as you have more than one frame in the web page. I believe that you can't stop the loading of a page once it's started. It's really up to you to filter out the html code by having it loaded separately and ask IE to process it.