Reusing Browser Technology - VBWebBrowser

Description: This sample demonstrates how to host the WebBrowser Control in a Visual Basic application.

More Details

The WebBrowser Control exposes a set of methods, properties and events which allow a hosting application to exercise control over such things as Web and local file system navigation, printing, changing font sizes and other typical browser functionality. This sample shows you how to utilize these methods, properties and events in your hosting Visual Basic application.
In addition, this sample demonstrates how to access other Internet Explorer functionality that is not directly exposed by the WebBrowser Control, such as showing the "Internet Options..." and "Find (on this page)" dialogs. Other functionality exposed by Internet Explorer is also implemented, such as the Favorites and other menu items.

Finally, the sample demonstrates how to access the Dynamic HTML Object Model from within the hosting application by inserting script events onto the page.

Browser/Platform Compatibility

This sample application requires Internet Explorer 4.0x or Internet Explorer 5. While you are not required to utilize Internet Explorer as your default browser of choice, it must be installed on the target computer. Hence, applications that host the WebBrowser Control must also redistribute Internet Explorer. Refer to this Licensing & Distribution article for more information about redistributing Internet Explorer with your application.


As discussed in this Application Types overview to Reusing the WebBrowser Control, there are two common scenarios for hosting the WebBrowser Control in applications:
Web browsing applications host the WebBrowser control in order to focus development efforts on new and original browsing features. The advantages to basing browser applications on the WebBrowser control stem from avoiding the drudgery of implementing functionality already provided, as well as benefiting from the control's extensibility and customization features. This approach also leverages the controls standards compliance and provides compatibility with Web pages designed to take advantage of Internet Explorer.
Traditional applications host the WebBrowser Control in order to integrate a browsing experience. This ranges from browsing targeted content on the Web to presenting a rich user interface based upon Dynamic HTML. The advantages to creating elements of the application's user interface with Dynamic HTML include easier localization of content, built-in presentation and printing support, and streamlining the development process by allowing user interface specialists complete control over presentation elements. Some of the functionality demonstrated in this sample application is provided by the WBAddrBook COM component that is included in the sample files. In addition to providing the WBAddrBook source files for viewing and building the component, we've included the WBAddrBook.htm sample file. Opening WBAddrBook.htm in Internet Explorer will install the WBAddrBook component on your computer, enabling you to utilize the Visual Basic sample without having to build the WBAddrBook component first.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.