# VBForums CodeBank > CodeBank - C# >  Enhanced CS Tabbed Web Browser

## gep13

*Enhanced CS Tabbed Web Browser*.  Last updated: 23rd July 2010

*Note:* VB.Net Version can be found here.

With the consent of jmcilhinney, I have taken the original Tabbed Web Browser code which you can find here:

http://www.vbforums.com/showthread.php?t=506103

C# version can be found here:

http://www.vbforums.com/showthread.php?t=609879

And started extending it to include some additional functionality.  The first major addition is the ability to enumerate and to the Favourites that are contained within the Users Favourites folder on their machine.  Details regarding how this was achieved can be found in this post:

http://www.vbforums.com/showthread.php?p=3764072

*Author name:*
Gary Ewan Park

*Update history:*

23rd December 2011

I took jmcilhinney's original code and added the following:
Favourites TreeView populated with all Favourites in User's Favourites FolderAbility to delete selected Favourite from TreeViewAbility to add new Favourite based on currently viewed web pageAbility to add new Folders within the Favourite FolderAbility to hide the Favourites TreeView

*Todo List:*
Implement Feeds SectionImplement History SectionAbility to delete entire Favourites Directory from TreeViewAdd icons to TreeView for both Directories and individual Favourites using FavIcons

Feel free to make more suggestions for things to add.

*Known Issues:*
None at present, but feel free to submit issues by posting a comment.

*Screenshots:*



*Latest Code:*
You can find this on github here:
https://github.com/gep13/VBForums-En...ed-Web-Browser

----------


## BenJones

Wow nice example of makeing a browser, I was going to make my own so that should give me some good ideas, thanks for sharing.

----------


## gep13

Thanks! Not a problem at all, have been meaning to post it for a while.

The main credit goes to jmcilhinney.  I have just taken his work, translated it into C#, and added a couple features  :Smilie: 

Gary

----------


## sireesha

Nice one, very usefull stuff.
I Practised it and found two issues in the tabbed browser,i.e Back button is enabled in the new tab and the textbox url is not changing according to the navigation in the new tab.
Please suggest me how to do this.

----------


## gep13

Hey,

Can you describe the exact steps that you are using to produce these problems?  They don't look like they should be happening, but if I can reproduce them, I will update the code with corrections.

Thanks

Gary

----------


## Amberg

Gep, Thankx for sharing you skills with us.
About the favoirites; how can the favorites be edited.

thanks for ur reply.

----------


## gep13

Hello Amberg,

If I remember correctly (it has been a while since I have looked at it), I haven't implemented this functionality.  At the minute, you can only add and delete.

It should be a simple extension of the current source code, so if I get a chance in the next while I will try to add this functionality.

Gary

----------


## gep13

Hello,

For anyone who is interested, I have moved the Code for this application onto github, you can find it here:

https://github.com/gep13/VBForums-En...ed-Web-Browser

Thanks

Gary

----------


## 5y5tem_reb00t

Anyone else have trouble running this? Whenever i try to debug
NullReferenceExemption was unhandled
this.tabs.AddTab();
Line 83 MainWindow.cs

and

Warning	1	Field 'Enhanced_CS_Tabbed_Web_Browser.MainWindow.tabs' is never assigned to, and will always have its default value null
@
Enhanced CS Tabbed Web Browser\MainWindow.Designer.cs	537	69	Enhanced CS Tabbed Web Browser

I'm only a beginner so it's more than a bit confusing!

----------


## gep13

Hello,

I am sorry to hear that you are having problems with this.

Can you show a screenshot of what you are seeing?

Thanks

Gary

----------


## 5y5tem_reb00t



----------


## gep13

Hello,

Did you download the code directly from GitHub, and open it in Visual Studio?  Did you make any changes?

Gary

----------


## 5y5tem_reb00t

The .sln file icons are different, when i click on the .sln icon from your project it does nothing (nothing opens) i have to open visual studio first then file > open project.

----------


## gep13

Hello,

Are you using Windows 7, and do you have UAC turned on?  I so, this might be why the sln file is not opening, as it is definitely valid.

You can find out more information about this here:

http://blog.davidebbo.com/2011/04/op...-as-admin.html

and here:

https://www.re-motion.org/blogs/mix/...hen-launching/

I have upgraded the project on GitHub to now use Visual Studio 2010, and I have just verified that I can open the solution file, compile the code, and debug it, and it works without any problems.

Can you try the new code, and let me know how you get on?

Gary

----------


## 5y5tem_reb00t

I'm on windows XP with visual studio express

----------


## gep13

Hello,

I am not in a position to test that setup, as I do not have a machine with that configuration to hand.

Have you tried the new version? Or which edition of Visual Studio Express are you using?  2008, or 2010?

Gary

----------


## 5y5tem_reb00t

Thanks for the replies.
Tried both 2008 and 2010, with 2010 I had to convert before opening but still got the very same coding error.

----------


## gep13

Hello,

Ok, can you explain the exact steps, from start to finish, in order to generate the error?

I am just not seeing it.

Sorry.

Gary

----------


## 5y5tem_reb00t

Here's the screen i get when first opening



Then after clicking ignore and continue




To get the code error i just run debug

----------


## gep13

Ok, I am going to have to get Visual Studio Express installed, and try this out.  It works fine on the edition of Visual Studio I am using.  I will do some research, and get back to you.

Gary

----------


## gep13

Hello,

Okay, this is what I did, step by step:

1. Went to here
2. Clicked the zip link to download everything
3. Unzipped the zip file
4. Opened Visual C# 2010 Express Edition
5. Select File | Open Project...
6. Navigate to the folder that contains the .sln file
7. Select the .sln file and select Open
8. Build the solution, CTRL + SHIFT + B
9. Hit F5
10. Works as expected

Try the above, and let me know what happens.

Gary

----------


## 5y5tem_reb00t

Yeah it runs when i click F5 and loads google.com then if i click to visit a further webpage i get the picture below.
I'm only a beginner and have no idea what these error codes mean. sorry to be so critical.

----------


## gep13

Ok, in order to best help you, you are going to need to help me.

Can you explicitly list all the steps that you carry out between loading the application, and then the above happening.

Gary

----------


## 5y5tem_reb00t

I followed your instructions on post no:21 and the application loads as normal
then:

Type www.google.com into the address box press enter
Google loads as per normal
I then enter a search phrase into Google press enter
get results as expected
click on one of these search results page loads
if i click on a link on that webpage get error above
'Argument out of range exemption', Value of 5310 is not valid for value, value should be between minimum and maximum, parameter name: value.

I found a MSDN link http://msdn.microsoft.com/en-us/libr...exception.aspx

----------


## gep13

Hello,

Ok, I have just tried to repeat this, and I can't get it to give the same error that you have described.

The search term that I used was "test" and I can happily click on each of the links that the search returns, and each one appears in the tab as expected.

Can you tell me the search term that you used, and what link you tried to click on?

Gary

----------


## 5y5tem_reb00t

I entered 'test' into google
clicked the first link test.com > individuals
then clicked the back button four times to return to google and got same error with above but with

'Argument out of range exemption', Value of 10000 is not valid for value.

The re-opened it with F5
went to google entered 'nfl' got search results but then error

'Argument out of range exemption', Value of 4283 is not valid for value,

The  opened again

went to google entered bbc
bbc homepage > news > world > UK > England

then get error

'Argument out of range exemption', Value of 10000 is not valid for value,

I altered the number on the row of code to 1000000000 and not 100 and as soon i visited google i got the error

'Argument out of range exemption', Value of 10000000 is not valid for value

I altered the number on the row of code to 10 and as soon i visited google i got the error

'Argument out of range exemption', Value of 1000 is not valid for value

----------


## 5y5tem_reb00t

I removed the whole of line 399 from Mainform.cs
this.pageLoadProgress.Value = (int)Math.Round(((double)(1000 * e.CurrentProgress / e.MaximumProgress)));

Seems to have cured it  :Smilie:

----------

