This course - Tips on how to use the web browser control
v1.0 -
last updated:
08/07/2006
In the event handler for the browser's Back button, you'll need this
snippet:
if (webBrowser1.CanGoBack) webBrowser1.GoBack(); You'll need a similar approach for the Forward button.
I used the webBrowser1_Navigating event handler to enable my Stop button
and initialize the progress bar to 0. Sometimes you need to call the
Invalidate() method to force controls to repaint when you make changes like
these.
I used the webBrowser1_ProgressChanged event to update the progress bar.
I used the webBrowser1_DocumentCompleted event to stop all the stuff the
above two event handlers were doing.
Here's code to fill up the web browser with a web page: