he phenomenal popularity of the new Firefox browser from Mozilla.org is no random happenstance. Web users around the world have discovered what dozens of reviewers pointed out back in its beta: Firefox's tabbed UI, where multiple browser pages are consolidated into one application instance using tabs, is a great way to surf. Not only is it more convenient to change between browser instances but it saves tons of room on the Windows toolbar.
Microsoft hasn't (yet) updated IE to copy this great functionality but you can beat Redmond to the punch using new features of Windows Forms 2.0. As part of the .NET Framework 2.0 and Visual Studio 2005 (Whidbey) release, WinForms 2.0 is currently still in beta but the new controls and features demonstrated in this article are ready for you to put them to work in an IE transformation.
In this article, you'll get acquainted with WinForms 2.0's WebBrowser control, which will be the magic behind this tabbed browsing feature.
|Figure 1. Movable: Toolbars and menu bars in EnhancedIE can be moved and customized.
As I am going to build a relatively feature-complete Web browser, I shall walk through the features set before I explain how to build the application, which I've named EnhancedIE.
MenuStrip and ToolbarStrips
EnhancedIE has movable toolbars, just like the normal IE. In my application, you can move the menubar, toolbars, and address bar (see Figure 1).
EnhancedIE contains an address bar where you can enter the URL of the Web site you wish to visit (see Figure 2). This address bar supports the Autocomplete feature, which completes previously visited URLs as you type. You can also click on the drop-down arrow in the address bar to see a list of URLs that you have typed previously (see Figure 3).
Figure 2. Autocomplete: EnhancedIE finishes familiar URLs for you.
Figure 3. Good Memory: The application displays a list of previously typed URLs.
|Figure 4. Viewing Live Bookmarks: The content shown is dynamically fed from three RSS feeds. Users of EnhancedIE can choose any RSS feed they like. |
EnhancedIE will support a new feature known as Live Bookmark (another feature available in Firefox). Using a live bookmark, you can reference an RSS news feed and display its content title just like a normal bookmark. Because it dynamically reads from RSS, content in live bookmarks is always up-to-date.
Figure 4 shows three live bookmarks in EnhancedIE:
- CNET ReviewsMost Recent Reviews
- DevX: Latest Published Articles
- MSDN Just Published
To read a particular piece of news, simply select the relevant menu item and it will display in the current tab page. To display all the news items in multiple tab pages, select "Open in tabs." If you click on the tabs to move between pages:
- The current URL of the page is displayed in the address bar
- The current URL of the page is also displayed in the status bar
To close a tab page, right-click on the tab you want to close and select "Close Tab."
|Figure 5. Subscribing to a News Feed: To add a live bookmark you just need the URLs of your favorite RSS feeds. |
To subscribe to live bookmarks select "Add Live Bookmark …" from the Favorites menu (see Figure 5
). You'll be prompted to enter a news feed URL.
Live bookmarks are stored in the "My Documents" folder on the user's computer. Each live bookmark is saved as a plain text file with a ".live" extension. The content of each file simply contains the URL of the feed.