The examples presented in this chapter, using the new Web site administration tool and login controls, clearly
In the
After writing seven chapters about the wonders of Web Forms applications, I must
Improvements to Windows Forms applications have not taken place in isolation from the Internet and Web Forms applications. For example, ClickOnce deployment of Windows Forms applications is a new feature of Windows Forms applications in .NET 2.0 that
A less-heralded improvement, but one that is significant for Web Forms developers, is the inclusion of the WebBrowser control. The WebBrowser control is a managed wrapper around the Microsoft ActiveX control that Microsoft Internet Explorer uses to display Web pages. Strictly speaking, developers always could use the ActiveX Web browser control in their applications; however, the WebBrowser control makes it a great deal easier. The WebBrowser control is the focus of this chapter. Details will follow, but first, let's take a brief look at what the control can do.
To test out the new WebBrowser control, we first need to create a new Windows Forms application. In Microsoft Visual Studio 2005, select New on the File menu, and then select Project. The New Project dialog box appears, as shown in Figure 8-1.
Figure 8-1:
The New Project dialog box in Visual Studio, set to add a new Windows Forms application
In the Project Types list on the left, expand Visual C#, and then select Windows. Select Windows Application from the list of installed templates on the right.
Figure 8-2:
New Windows Forms application in Design view
From the Common Controls
Figure 8-3:
Windows Forms application displaying the Microsoft Press home page in a
WebBrowser
control
With no code, and a single property setting, we have a very simple, serviceable Web browser. If you right-click the WebBrowser control, the menu that appears is the same menu that appears when you right-click a Web page in Internet Explorer, allowing you to go back and forward, view the source of the page, and so on.