Click here to Skip to main content
15,880,469 members
Articles / Programming Languages / C#
Article

ZeBrowser : Easy to build a browser using VS.Net 2005's new controls

Rate me:
Please Sign up or sign in to vote.
2.73/5 (16 votes)
3 Jul 20043 min read 78.7K   1.7K   32   9
Shows how easy it is to build a browser using VS.NET 2005

Image 1

Figure 1.

Introduction

In this article I would like to show you same new controls in the VS.NET 2005 (Whidbey). Microsoft has improved many existing controls and created new ones that have made the design and build of Windows and Web applications very productive and intuitive.

Here I comment the use of some of these new controls developing, in short time, a browser that I called ZeBrowser. The ZeBrowser application has many of the common functionalities of a browser like go forward, back, stop and refresh the page. These new controls have a lot of nice features but the target of this article is only to mention some of them. You can see more VS.Net 2005 images at http://www.byteshift.com/Galeria+de+Fotos/default.aspx.

Using the code

There are many improvements in this new version like VS.Net custom settings, IDE improvements, C# 2.0 with new features, Class Diagram and many others things. If you are interested to see more details, please take a look at http://msdn.microsoft.com/vs2005/. Of course that there are many others links where you can find useful information.

Well, let’s write code. In this project I used only 6 controls: OpenFileDialog, MenuStrip, ToolStrip, StatusStrip, SplitContainer and the WebBrowser control.

For backward compatibility reasons, Microsoft has preserved the similar controls of these xxxStrip controls. Let’s go ahead.

SplitContainer

Image 2

Figure 2.

Image 3

This control has a more intuitive behavior from the old one because it already creates two views as you can see in Fig. 2. I used the left view to display the history browse and the right view to accommodate the browser

MenuStrip

Image 4

Figure 3.

In the new MenuStrip control, you have 4 predefined controls in one: MenuItem, ComboBox, Separator and TextBox.

When you use a xxxStrip control, you will see that it has a little right icon that, when clicked, enable the developer to configure the property control in the control itself as you can see in Fig.3. Also, you can easily add an image to the menuitem as showed in the figure. This obviously enables you to create a friendlier menu.

ToolStrip

Image 5

Figure 4

This control also has a predefined a Button, ComboBox, SplitButton, Label, DropDownButton, TextBox and a Separator control. Also, a ToolStrip control can host virtually any other control via ToolStripControlHost. Using a few lines of code, I hosted a ProgressBar in the ToolStrip to show the browse page navigation as you can see in the Fig. 4.

StatusStrip

Like ToolStrip, StatusStrip has predefined controls also. Is has a Panel and a StatusBar control.

WebBrowser

Now you doesn’t need to import a COM control do add web functionalities to your .Net application. With Whidbey class libraries you need just open the Toolbar and drag-and-drop the WebBrowser control that has a collection of methods, properties and events to enable you to implement all web functionalities in your .Net application. You will see that the snippet code for the WebBrowser is very simple.

Points of Interest

What I could see with these new controls is that because now you have a set of controls in one container the productivity is leveraged and the final look and feel is much better than with the older controls as well.

History

Microsoft has released the Visual Studio Beta 1. If you are a MSDN subscriber, you can download the package from MSDN site. Otherwise, you can download product of your choice from the Visual Studio 2005 Express line product in this link

I revised the project and fixed a bugs with the ProgressBar that fired an exception in some conditions. So now you can use the new Visual C# 2005 Express to run ZeBrowser. Enjoy!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralThe code cannot be compiled over VS 2005 Pin
tbenami27-Dec-06 21:26
tbenami27-Dec-06 21:26 
AnswerRe: The code cannot be compiled over VS 2005 Pin
carlao28-Dec-06 16:10
carlao28-Dec-06 16:10 
GeneralI find a free web browser control. A rich client solution is provided. Pin
mynewbigame26-Dec-04 0:42
mynewbigame26-Dec-04 0:42 
GeneralA free web browser control is available. A rich client solution is provided. Pin
mynewbigame26-Dec-04 0:39
mynewbigame26-Dec-04 0:39 
GeneralWhere to get VS.NET Beta Pin
Anonymous4-Jul-04 21:39
Anonymous4-Jul-04 21:39 
GeneralRe: Where to get VS.NET Beta Pin
lievin4-Jul-04 21:52
lievin4-Jul-04 21:52 
GeneralRe: Where to get VS.NET Beta Pin
carlao5-Jul-04 5:56
carlao5-Jul-04 5:56 
GeneralRe: Where to get VS.NET Beta Pin
carlao5-Jul-04 7:09
carlao5-Jul-04 7:09 
GeneralRe: Where to get VS.NET Beta Pin
kacza5-Jul-04 10:10
kacza5-Jul-04 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.