# VBForums CodeBank > CodeBank - Visual Basic .NET >  Enhanced VB Tabbed Web Browser

## gep13

*Enhanced VB Tabbed Web Browser*.  Last updated: 23rd December 2011

*Note:* C# 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

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.p...59#post3764059

*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

----------


## Megalith

thanks for this gary, welcome additions to the jmc code  :Smilie:

----------


## gep13

> thanks for this gary, welcome additions to the jmc code


Thank you very much  :Smilie: 

I have a couple other ideas about what I would like to include in subsequent versions, it is just a case of finding the time.  I am going to finish the C# version of the above, and then think about what I am going to do with it.

Gary

----------


## Dcurvez

hi Gary

first off I want to tell you that this is an awesome tutorial  :Smilie:  very well put together. I have taken the liberty of downloading the zip zile and trying to build it myself step by step. I am pretty sure that when all is said and done I will walk away from this knowing a ton more. 

however at the moment I am down to 73 errors LOL..i THINK that MOST of these errors are stemming from the fact that I did not use the right controller on the main form. specifically the main frame. You have it labeled "tabs" and i ASSUME that this is the tab control..but I am not so sure about that because in reality the code is pointing to tabbed web browser..so can you please explain to me which it is?? tab contol or web browser control...or both LOL..and if it is both, can you teach me how to incorporate both?? I tried putting a tab control down..and deleting the tabs..then placing a webbrowser control on top of that..well you know how that worked  :Frown:  it will not do it..LOL!!

----------


## gep13

Hello Dcurvez,

I am not sure that I follow.

Have you made changes to the application, or are you seeing errors when you first try and run the application?  If so, what version of Visual Studio are you using and what exactly are the errors that you are seeing?

Gary

----------


## Dcurvez

hi gary and thank you for the quick response  :Smilie: 

I am running vs 2008.

i have not made a change one to anything..because I am fairly new at this and am not that confident to change something LOL..i mean outside of colors and images and stuff. but as far as actual code I do not change it. What the purpose of all of this for me was for learning. I like the way code is "categorized" in "regions" and how each of these "categories" are actually deemed to be what they are  :Smilie: ..I know a little of alot of things cuz I have a great friend over at Daniweb that has taken his time to "tutor" me on a personal level. He has introduced xml..and listviews..and datagridviews..ect. to me and has shown me quite a bit..I seen this tutorial as a way to use some of what he has shown me!

anyway I do know what the problem is based on the errors I am getting. It is basically telling me that I have not built the web browser/tab control..controller correctly. and until I do..most of the code will not work.

what I have done so far is i figured out that you have a split panel on the main form. on the left side (panel 1) you have a tab control that holds the favorites/feeds/history. then on panel 2..what I think you did was lay a tab control down..and placed a web browser in that tab control. At first I could not get the web browser to go onto the tab control, would not let me. But then I brought this to my friend..and he explained to me that I would have to go back over to Jims site (the original poster of the original project) the one you list at the beginning of your tutorial..and type that code into my form in order for me to get the web browser to lay on the tab control. So I did that. and after that I did get the web browser into the tab contol. but all that has gotten me just that LOL..a tab control with a web browser in it. I do not understand how you got the "tabbed Web Browser" 

Cuz i still have ....lol...a tab control and a web browser lol.  i dont know what to do to achieve a control called "tabbed web browser"

i dont know how to combine the 2 tools (tab control and web browser) to make one control..dont know really how to explain it any better  :Frown:

----------


## Dcurvez

if it would help Gary, I can post some of the errors here. but I didnt change a thing..I did name my application "mini Web" cuz it is sitting in my practice folder.

I can post some of the errors here in about a hour cuz right now I got house cleaning stuffs to do.

----------


## gep13

Hey,

The code that I posted should work without you having to do anything, so I will need to do some digging to see what is going on there.

Can you clarify what version of VS 2008 you are using?  i.e. the express edition, Standard, Professional etc, this will help in finding out what the problem is.

Also, a screen shot of the error would be useful.

Gary

----------


## Dcurvez

hi Gary  :Smilie: 


yes I am using 2008 Pro.

I went through and typed this out in word so I can post it here without skipping around too much..here is most of what is happening:

‘Tabs’ is not  a member of ‘mini_web.MainWindow’
‘StartWithHomePage’ is not a member of ‘mini_web.My.MySettings’
These types of errors just go on and on..for a total of about 62.

There is 1 error that is a clue as to why the other 62/3 are existing…


This one is telling me that if I were to get this “tab Control and Web Brower” combined into one..then MOST of the errors I have will disappear:

Base Class ‘System.Windows.Forms.TabControl’ specified for Class ‘WebBrowserTabControl’ cannot be different from the base class ‘system.ComponentModel.Component’ of one of its other partial types.

So when I seen this particular error I studied more on your properties of the “panel 2” window and noticed that you have this panel showing as :
Tabs Enhanced_VB_Tabbed_Web_Browser.WebBrowserTabControl.

On mine it is listed in properties as:
2 different instances…one for the tab control under the web browser LOL..
Tabcontrol1 system.Windows.Forms.TabControl
AND when clicking on the main tab control area..I have a web browser with property listing of WebBrowser1 system.Windows.Forms.TabControl.

On yours you click on the white box of your panel2 and it shows:
WebBrowserTabControlTasks

On mine..
WebBrowser Tasks


For my forms I have:
AddFavoriteDialogue.vb……….windows form
CreateFolderDialogue.vb………windows form
FavoriteDirectoryInfo.vb………Class Form
FavoriteTreeNode.vb…………..Class Form
MainWindow.vb……………….Windows Form
OptionsDialogue.vb…………….Windows Form

These two forms are where a problem is:
From the icons on your forms..I guessed that these forms were built on a component forms..so I did this.




 WebBrowserTabControl.vb…………Component Form
WebBrowserTabPage.vb…………….Component Form




However..your Forms show in properties that they are windows forms.
WebBrowserTabControl system.windows.forms.TabControl
And:
WebBrowserTabPage system.windows.forms.TabPage


So,,I think that I really missed something here LOL as your program runs great with no bugs..obviously it is not your end it is on mine for sure LOL.

I either did not understand something (obviously) or something just went flyin right over my head! (even more obvious)

Anyway, I did not do the properties on the main window in panel2 yet that is why they are still labeled TabControl1 and WebBrowser1..I did not do the properties and stuff yet because I know I did not do something right in combining the 2 together..*sigh*

Really want to get this and stuff, but at the moment it seems I am failing miserably  :Frown:

----------


## gep13

Ok, let me take a look at this, and I will get back to you...

Might be tomorrow though.

----------


## Dcurvez

that is fine  :Smilie: 

my panic is not yours LOL

thank you for taking the time!  :Smilie:

----------


## gep13

Hey,

Ok, I have just downloaded the zip file attached to this thread, extracted it, built it, and it compiled without any errors?!?

Can you try downloading the file again, and build the application without making any modifications?  Does it work?

From the errors that you are getting, it looks like you are trying to rename the project to start at mini_web, is that the case?

WebBrowserTabControl and WebBrowserTabPage are not forms, but rather they are custom controls, that derive from TabControl and TabPage respectively, and extend the base functionality.

Gary

----------


## Dcurvez

good morning Gary  :Smilie: 

yes, your file the one that is attached here..when I first found it, I did download the zip file and ran it and it ran perfectly without any errors, and still does  :Smilie: 

I then created a new project and named my application Mini Web because I have a folder on my computer that is called "practice" and that is where I store tutorials and such that I run across.

and yes you are correct about renaming I am not using "enhanced Web Browser" anywhere in my forms..they are being renamed based off the application name I gave this practice project "Mini Web"

The errors have dwindled down now to 54.  :Smilie: 

these errors I am having are in no way reflecting from your project..they are soley on my end. I think the problem has been located and with any luck by the end of the day I will be posting back to you a success story!  :Smilie: 

again, your tutorial is awesome and is working fine! somewhere however when I recreated it...lol I am in error LOL (which is not at all surprising!)

lemme see if we cant get this recreation to be as good as the original  :Smilie: ..LOL the biggest part about learning is figuring out where ya screwed up at eh??? hehehheheheeeee ( I apparently did a dooooooooooozey!)

----------


## Emcrank

I think what hes done is tried to use the WebBrowserTabPage.vb and WebBrowserTabControl.vb in his project. Anyway onto my question, i have added them 2 class's to my project. When the project loads i have a webbrowser1 already in the manual designer and it has 1 tab this is my default tab. Then i have a button to add new tabs. What i was wondering is how can i call which is the currentbrowser? Like the one that is on the selected tab page? Thankyou for your time, hope you can help  :Smilie:

----------


## gep13

Hey,

If you look at the source code for the project, you will see that the WebBrowserTabControl.vb class (which is a custom class which derives from the TabControl class in the .Net Framework, handles the work of maintaining the SelectedWebBrowser, which is essentially the CurrentBrowser.  If you have included the WebBrowserTabControl.vb in your project, then you should already have access to this.

Gary

----------


## Emcrank

Yes thankyou ive done it  :Smilie:

----------


## gep13

> Yes thankyou ive done it


Glad to hear it!!

----------


## dewshare

there is a bug, i am facing same problem I open youtube link in a tab. i close that tab but still voices are coming. tab is removed but page is still there. 

any solution please ???

----------


## gep13

Interesting, let me take a look at this, and I will post back.

Gary

----------


## dewshare

I solved using this code before removing Tab. 




> CType(tabs_control.SelectedTab.Controls.Item(0), GeckoWebBrowser).Dispose()
>                 tabs_control.TabPages.Remove(tabs_control.SelectedTab)

----------


## gep13

This work should of already been being handled in the RemoveCurrentTab() method.

Looks to me like you are changing the code to be specific to what you want.  Did you omit this method?

Gary

----------


## dewshare

may be i omit. but this code work for me.

----------


## gep13

So to be clear, you are modifying the existing code.  is that right?

Where did you put the above code?

Gary

----------


## MrTree

I cant seem to get the WebBrowserTabControl into the form, ive tried compiling WebBrowserTabControl.vb and WebBrowserTabPage.vb on their own with no luck, and I cant seem to drag the WebBrowserTabControl.vb into the form, it wont allow me, it shows a circle with a line through it when I drag it over, meaning I cant do it. Im using Visual Studio 2008 Pro.

Thanks

----------


## gep13

Hello there,

When you add the user controls into the project, Visual Studio should automatically add them into a new section at the very top of the Toolbox.

If you have put these controls into their own project, and you are simply referencing the DLL, then you will likely need to add them manually to the Toolbox.  This can be done by right clicking on the toolbox, and selecting "Choose Items..." then browse to the DLL, and then choose the control.

Gary

----------


## MrTree

Its not letting me at all, when I try add the DLL, it comes up with an error message box saying 
"no user controls found in this .dll"

And when I try dragging the WebBrowserTabControl.vb to the form it gives me a denied icon, not allowing me to put it on.

----------


## gep13

Have you tried running the application that is attached to this thread?

Can you see the Control in the top left hand control, ready to be added to the form?

Gary

----------


## MrTree

Ok its the first time this has happened, but this is the error I get now trying to open your project file.

Ive linked it because its quite big image.

http://img820.imageshack.us/img820/9...studio2008.png

----------


## MrTree

Ok that error has now gone, due to a restart for some reason, even when I open your project file, I cant see the control in the toolbox.

----------


## gep13

> Ok its the first time this has happened, but this is the error I get now trying to open your project file.
> 
> Ive linked it because its quite big image.
> 
> http://img820.imageshack.us/img820/9...studio2008.png


I have seen this error as well, and I have never traced exactly why this happens, however, if you build the solution, it will go away.

Gary

----------


## gep13

> Ok that error has now gone, due to a restart for some reason, even when I open your project file, I cant see the control in the toolbox.


With the solution built, and the main form open in the designer, you should see the following:



Gary

----------


## MrTree

Im not sure what you mean by "built" if you mean compiled (Right click project > build) then, it still does not show up in the toolbox.

This is my toolbox:

----------


## gep13

Do you have the form open in design mode when you are trying?

Gary

----------


## MrTree

Yes I do.

----------


## gep13

Ok, this makes no sense.  Have you made any changes to the sample project, or are you running the extracted version of the project which it attached to this thread?

Gary

----------


## MrTree

I am running the extracted vesion of your project which I have redownloaded just in case. But still does not work.

----------


## MrTree

Ok well ive managed to get it to work in your project, but it does not appear in my project toolbox only yours. why could that be?

----------


## gep13

So...

What did you do differently to get my project working?

What have you done to bring the user controls into your project?

Gary

----------


## MrTree

Right click on the project name in the solution explorer, and then click Add > Existing Item... then select your WebBrowserTabControl.vb and WebBrowserTabPage.vb

----------


## gep13

Hello,

I have followed the exact steps that you have shown above, with the exception of one additional step...

Right click on Project and Select Rebuild.

And the control appears in the Toolbox, ready for dragging and dropping onto the form surface.

Gary

----------


## MrTree

It seems like it has worked but its now saying:


If its any help im running Windows 7 Ultimate 64-bit

----------


## MrTree

Ignore this, its now fixed it self, thank you very much  :Big Grin:  I can now use your WebBrowserTabControl, thank you.

----------


## gep13

Hey,

Glad to hear it!!

Gary

----------


## coolcurrent4u

@gep
this is wonderfull

----------


## gep13

> @gep
> this is wonderfull


Why thank you very much!  Glad you like it.  The majority of the praise has to go to jmchilhinney though, I just extended his existing work  :Smilie: 

Gary

----------


## coolcurrent4u

i found a bug in the code. first before reporting the bug, let me ask a related question.

How do you display progress in the progress bar when you switch tab?.

Next here is the bug



```
Value of '10026' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'. Parameter name: Value
```

the image below show it exact

----------


## gep13

Hello,

Are you able to provide a complete step of steps to reproduce this issue?

Thanks

Gary

----------


## gep13

Hello,

Are you able to provide a complete step of steps to reproduce this issue?

Thanks

Gary

----------


## coolcurrent4u

just browse with more that one tab, say about 3 to 4 and switch tabs while the pages are still loading frequently, say every 3 sec or 5

----------


## 3no7ch

Wow, nice. Oh well, I'm going to just modify stuff around to see if there's anything useful that I can see in the code.

----------


## gep13

> Wow, nice. Oh well, I'm going to just modify stuff around to see if there's anything useful that I can see in the code.


Sounds like a plan!  Let me know if you have any issues, or whether you add anything interesting.

Gary

----------


## gep13

> just browse with more that one tab, say about 3 to 4 and switch tabs while the pages are still loading frequently, say every 3 sec or 5


I haven't forgotten about this issue, I just haven't had a chance to look at it yet.

Gary

----------


## Grunt

I am thinking of doing something like this, but instead of going with the vanilla browser control, to using embedded firefox with xulrunner. I will post some stuff on it in the future.

----------


## gep13

Hello Grunt,

Sounds interesting!  Will be good to see how you get on.

Gary

----------


## JuLiAnc

Hi, 

First of, I would like to give you a well done  :Smilie:  very nice project. and nice design. - Although some things I have found to "pop out". 

1. The history doesn't update itself? when you go into new websites...
2. Maybe make the tools dialog a bit bigger and include the Clear History etc in there, like um, Last Hour Cache etc.
3. This might also be my personal preference: Adding the add new tab button in the tabs.
4. It doesn't support Multimedia, such as metacafe movies, (because of flash player)...

other than that I love it.  :Smilie:

----------


## gep13

Hello,

Thanks for the feedback.

1) As per the notes at the top of the thread, the history tab has not yet been implemented
2) Again, this hasn't been looked at yet
3) Good idea
4) I can't say that I have tried this, but this could be a limitation of the WebBrowser control that is being used.

Gary

----------


## JuLiAnc

> Hello,
> 
> Thanks for the feedback.
> 
> 1) As per the notes at the top of the thread, the history tab has not yet been implemented
> 2) Again, this hasn't been looked at yet
> 3) Good idea
> 4) I can't say that I have tried this, but this could be a limitation of the WebBrowser control that is being used.
> 
> Gary


Hey Gary,

Thanks for your reply.

1) I didn't read the entire top thread (lazy me), you're planning on implementing it though? it would be awesome with history included.
2) Maybe even some security level modifications in the tools? that comes to my mind: "Parental Control", to even limit websites that have *sex* or what so ever wild card in the website, to ask if you want to continue to a website which has certain words in its URL.
3) Another thing that you might like to implement, is the ability of "Clicking" on the tab while keeping the mouse button down a "Close" button will pop up, which will give more comfort for the user. (ease of use is very important for me personally)
4) I understand. even limitation of Adobe Flash, as it doesn't support all browsers, but.... as VB's Web implementation uses IE engine (I think), it should let one use multimedia, maybe theres a way around?

Julian

----------


## gep13

Hello again,

1) One day I hope to get back round to looking at this, yes.  As with most things though, it really depends on what other stuff I have on, and at the minute I have lots  :Frown: 
2) Agreed, this would be a useful addition.
3) Nice suggestion.
4) Off the top of my head, really not sure, would need to look into this.  Do you have a link to a site that you have tried where it hasn't worked?

Gary

----------


## JuLiAnc

> Hello again,
> 
> 1) One day I hope to get back round to looking at this, yes.  As with most things though, it really depends on what other stuff I have on, and at the minute I have lots 
> 2) Agreed, this would be a useful addition.
> 3) Nice suggestion.
> 4) Off the top of my head, really not sure, would need to look into this.  Do you have a link to a site that you have tried where it hasn't worked?
> 
> Gary


Hey Gary,

1) Looking forward for that.
2) I agree.
3) Thank you 
4) metacafe doesn't work for sure, as I tried to see if media is supported and nothing comes up in the 'movie' box.

Julian

----------


## coolcurrent4u

Hello Gary

I'd like to auto fill form fields in the multitab webbrowser control, in the document complete event, how do i fill the correct webbrowser?

----------


## gep13

Hello,

There is already a reference to the current Selected Tab, so surely you should already know which browser you want to fill, or what am I missing?

Gary

----------


## coolcurrent4u

Thanks for responding.

Is it possible to add close button to each tab, can you give me a hint on how i can do that

thanks

----------


## gep13

Hello,

You would need to "paint" a button onto each TabPage, and handle the click event of it.

Pradeep has an example of doing this here:

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

Gary

----------


## coolcurrent4u

Thanks, but i can't use it in .net 2.0 as it uses linq

----------


## gep13

Hello,

One line of that code sample uses LINQ.  It should be simple enough to factor LINQ out.

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

----------


## therealianc

Anyone tried this in Visual Studio 2012 pro?

Without making any changes when trying to run it I get an error

URI Format Exception was unhandled - Invalid URL: The Format of the URI could not be determined?



> myFav.Url = New Uri(sb.ToString())"

----------


## gep13

Hello,

No, I can't say that I have tried this in Visual Studio 2012, but I also can't think of any reason why it wouldn't work.

I will add it to my list of things to look into.  I will report back if I find anything.

Also, on the line that you have identified, can you set a breakpoint and find out what the value of sb.ToString() is?

Gary

----------


## therealianc

Hi,

This is the just copying the text from the unhandled exception.



> System.UriFormatException was unhandled
>   Message=Invalid URI: The format of the URI could not be determined.
>   Source=System
>   StackTrace:
>        at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
>        at Enhanced_VB_Tabbed_Web_Browser.MainWindow.GetFavouritesForDirectory(DirectoryInfo di, TreeNode dirNode) in C:\Users\Ian\Downloads\VBForums-Enhanced-Tabbed-Web-Browser-master\VBForums-Enhanced-Tabbed-Web-Browser-master\src\VB\Enhanced VB Tabbed Web Browser\MainWindow.vb:line 420
>        at Enhanced_VB_Tabbed_Web_Browser.MainWindow.GetFavourites() in C:\Users\Ian\Downloads\VBForums-Enhanced-Tabbed-Web-Browser-master\VBForums-Enhanced-Tabbed-Web-Browser-master\src\VB\Enhanced VB Tabbed Web Browser\MainWindow.vb:line 447
>        at Enhanced_VB_Tabbed_Web_Browser.MainWindow.MainWindow_Load(Object sender, EventArgs e) in C:\Users\Ian\Downloads\VBForums-Enhanced-Tabbed-Web-Browser-master\VBForums-Enhanced-Tabbed-Web-Browser-master\src\VB\Enhanced VB Tabbed Web Browser\MainWindow.vb:line 81
>        at System.EventHandler.Invoke(Object sender, EventArgs e)
> ...


Adding a break point say the following:




> Live Event: Breakpoint Hit: GetFavouritesForDirectory, MainWindow.VB line 42 A Breakpoint or tracpoint was hit by the debugger" Thread Main 8060.

----------


## gep13

Hello,

Yes, that is the stacktrace, but what was interested in was the actual value of the sb variable at the time the exception occurred.  If you set a breakpoint on that line, and then run the application, you should be able to inspect the value.

Gary

----------


## gep13

Hey,

I have just done the following:

1. Download the Source
2. Open the solution in Visual Studio 2012
3. Build Solution
4. Run the Application
5. Type www.google.co.uk into the address bar
6. Click go

And everything works as expected.

Can you let me know what you do differently?

Thanks

Gary

----------


## therealianc

Two screen shots attached.

First screen shot is if I just try and launch the application outside of the visual studio just as standalone application.
Second screen shot is simply opening the project and after build pressing the green play button.

Using Windows 8 if that makes a difference, although I've tried the standalone application on windows 7 and go the same netframe error in screen shot 1?

----------


## gep13

Hello,

Nope, Windows 8 shouldn't make any difference, I am also running that.

What favourites, if any, do you have set up in Internet Explorer?  Looks like one of these is not a valid URL.  It looks like you have identified a bug in the application though :-)

For now, again, what is the value of sb.ToString() when the exception occurs?  If you set a breakpoint on this line, you should be able to figure this out.  Are you familiar with how to do this?

Gary

----------


## therealianc

> Hello,
> 
> 
> What favourites, if any, do you have set up in Internet Explorer?  Looks like one of these is not a valid URL.  It looks like you have identified a bug in the application though :-)
> 
> For now, again, what is the value of sb.ToString() when the exception occurs?  If you set a breakpoint on this line, you should be able to figure this out.  Are you familiar with how to do this?
> 
> Gary


It appears if I delete the bookmark it has the problem with it runs the application. Until it gets stuck again with a bad url.

I'm not familiar enough with how to set a break point? Do I just click the line so it puts a red circle next to it? + What information do you require once it "breaks"

----------


## gep13

Hey,

Yes, that is essentially what you need to do, yes.  Once it "breaks" on that line, hover your mouse over the "sb" variable, and Visual Studio should tell you what the current value of sb is.  I am interested to know what the value is, and why it isn't a valid URL.  From there, we can start to figure out the best approach to handle correcting this problem in the code.

Thanks

Gary

----------


## therealianc

Sorry for the late reply. here is the information you required.

----------


## gep13

Hey,

So, that doesn't look like an invalid URI to me, so I don't think that this is the troublesome favourite.

Can you get to the above point again, and then press F5?  I suspect that you will land on this line of code again, this time with a different value for sb.  Keep doing this, inspecting the value of sb each time, until you once again get the exception being thrown.

Gary

----------


## therealianc

here are the screen shots. Also shown a screenshot of my favorites. Oddly if you delete the favorites for "bing, facebook, Microsoft, twitter" it loads without this error and can look into the folders fine.

----------


## gep13

Hello,

Ok, this is VERY confusing.  None of those are invalid URL's, and none of them should be throwing the exception that you are seeing.

Are you sure that there weren't other favourites in that folder when you were seeing this problem?

Thanks

Gary

----------


## Amerigo

I haven't looked at your code yet, but I have a feeling I just wasted 3 weeks creating my Tabbed_IE usercontrol.dll. I searched for months before creating one of my own.

@Grunt: I am also working on a Tabbed Gecko Browser control, but having issues adding it to a form. How are you coming along with yours?

----------


## gep13

Doh!  :Smilie: 

Feel free to use anything here that you think will be useful.  Kudos has to to go to John who created the original version, I just extended it slightly.

Gary

----------


## Amerigo

Well, I checked it out. I may be able to use some methods regarding favorites (favourites  :Smilie:  ). The browser itself still uses the default contextmenustrip which keeps "Open in new tab" grayed out and disabled. That is one of main reasons I made mine is to have a custom menu that will open links/images in a new tab. As is, yours only provides "Open in new Window" which launches IE. Using my tabbed browser control, it's not even possible to open a link in IE. Although, I may add the option to open in the default browser in case my .dll is used in an app that is not intended to be a regular browser.... Hmmm, back to work...

----------


## gep13

Cool, hopefully it will be of some use.

Feel free to fork the code, and make any updates  :Smilie: 

Gary

----------


## therealianc

Anyway of the treeview having more then one sub folder.

So if a favourite has folders inside of it, how can I make them show? Currently they don't display

----------


## gep13

Hello,

I have not looked at this code in a while, but it should simply be a case of recursing into each sub directory, and doing the same logic again.

If you don't get anywhere, let me know, and I will have a look at the code.

Gary

----------


## therealianc

> Hello,
> 
> I have not looked at this code in a while, but it should simply be a case of recursing into each sub directory, and doing the same logic again.
> 
> If you don't get anywhere, let me know, and I will have a look at the code.
> 
> Gary


I'll have a look at this again, I have been trying to find out which parts of the code do what.

Looking at this line here


```
            '   For Each dirName In Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
```

If you add to the end of "favourites)"


```
 "*.url", SearchOption.AllDirectories)
```

Then it shows everything but then nothing is in folders and everything has a + symbol against it.

May need to do a little research on "recursing" as I've not done / used that before. 

Will let you know how I get on. 
Thanks for any help in advance  :Smilie:

----------


## gep13

Hello,

Yes, you are definitely on the right lines  :Smilie: 

Where I am For Each'ing through the content of a single directory, you would need to do the same thing, for each directory within the root directory.  This is where the recursion is happening.

Let me know if you are having issues, and I will take a look.

Happy to take a pull request on the GitHub repo if you get this working  :Smilie: 

Gary

----------


## therealianc

> Hello,
> 
> Yes, you are definitely on the right lines 
> 
> Where I am For Each'ing through the content of a single directory, you would need to do the same thing, for each directory within the root directory.  This is where the recursion is happening.
> 
> Let me know if you are having issues, and I will take a look.
> 
> Happy to take a pull request on the GitHub repo if you get this working 
> ...


Hi Gary,

Been playing around with this for a couple of days but not getting any closer to the end result.

I sort of understand each line of code as i've been copying each line of code twice, running the program and seeing what changes / multiples.

The code i put before is as close as i've got.

So i'm kind of stuck.

----------


## gep13

Ok, I will see if I can grab some time at the weekend to make a change to the code on Github to include this.  To help with this, can I get you to add a request here:

https://github.com/gep13/VBForums-En...ser/issues/new

That way I am less likely to forget about it  :Smilie: 

Gary

----------


## therealianc

> Ok, I will see if I can grab some time at the weekend to make a change to the code on Github to include this.  To help with this, can I get you to add a request here:
> 
> https://github.com/gep13/VBForums-En...ser/issues/new
> 
> That way I am less likely to forget about it 
> 
> Gary


Done  :Smilie:

----------


## gep13

Just checked in basic fix.  :Smilie:

----------


## therealianc

> Just checked in basic fix.


Just tried it, works perfectly  :Smilie:  Thanks you for that.

Incase anyone else is reading and originally had the favourites loading to IE the code has changed slightly. 

This will work  :Smilie: 


```
    Private Sub FavouritesTreeView_NodeMouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles FavouritesTreeView.NodeMouseDoubleClick
            Dim myFav As FavouriteTreeNode = DirectCast(e.Node, FavouriteTreeNode)
            System.Diagnostics.Process.Start("iexplore.exe", myFav.Tag)

    End Sub
```

----------


## gep13

Not a problem at all.

Happy to help.  Let me know if there are any other feature suggetions, or bugs.

Gary

----------


## bjpdekker

Hello,

is it possible to change the event of clicking a link on a website? When you click on a link which opens a new page/tab, IE is opening a new window.
Is it possible to open a new tab in this web browser?

Thanks.
Bas

----------


## wingers

> Not a problem at all.
> 
> Happy to help.  Let me know if there are any other feature suggetions, or bugs.
> 
> Gary


Hi

I know this thread is a few years old but I had been searching for code to show IE favorites in a treeview and out of all the ones I tried - yours was the only one which worked perfectly for me!!

What I would like to try and do though is improve it so it shows the favorites icons/images as well i.e. like you see them in IE

And also how easy is it to show a folder icon next to each folder - just to make list look nicer?

Is this at all possible?

Thanks for the great article and app - has been very helpful for me

----------


## gep13

> Hi
> 
> I know this thread is a few years old but I had been searching for code to show IE favorites in a treeview and out of all the ones I tried - yours was the only one which worked perfectly for me!!
> 
> What I would like to try and do though is improve it so it shows the favorites icons/images as well i.e. like you see them in IE
> 
> And also how easy is it to show a folder icon next to each folder - just to make list look nicer?
> 
> Is this at all possible?
> ...


Hello wingers,

I am glad to hear that you are getting some use out of it :-)

All the source code for the Browser is located in my GitHub Repository: 

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

So feel free to create an issue over there for what you would like to see added, and we can see what can be done.  I don't "think" it should be too hard, but it has been a while since I have looked at this code.

Gary

----------

