9.19. Display a Web Page in a Windows-Based Application

Problem

You want to display a web page and provide web-navigation capabilities within your Windows Forms application.

Solution

Use the WebBrowser control to display the web page and other standard controls like buttons and text boxes to allow the user to control the operation of the WebBrowser.

The WebBrowser control is a managed wrapper around the WebBrowser ActiveX control, which is the same component used by Internet Explorer. This means that if you use a Main method, it must be annotated with the STAThread attribute. Furthermore, the component is very resource-intensive and should be ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.