-
1 Attachment(s)
Enhanced VB Tabbed Web Browser
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 Folder
- Ability to delete selected Favourite from TreeView
- Ability to add new Favourite based on currently viewed web page
- Ability to add new Folders within the Favourite Folder
- Ability to hide the Favourites TreeView
Todo List:
- Implement Feeds Section
- Implement History Section
- Ability to delete entire Favourites Directory from TreeView
- Add 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:
Attachment 77262
Latest Code:
You can find this on github here:
https://github.com/gep13/VBForums-En...ed-Web-Browser
-
Re: Enhanced VB Tabbed Web Browser
thanks for this gary, welcome additions to the jmc code :)
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
Megalith
thanks for this gary, welcome additions to the jmc code :)
Thank you very much :)
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
-
Re: Enhanced VB Tabbed Web Browser
hi Gary
first off I want to tell you that this is an awesome tutorial :) 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 :( it will not do it..LOL!!
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
hi gary and thank you for the quick response :)
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 :)..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 :(
-
Re: Enhanced VB Tabbed Web Browser
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.
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
hi Gary :)
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 :(
-
Re: Enhanced VB Tabbed Web Browser
Ok, let me take a look at this, and I will get back to you...
Might be tomorrow though.
-
Re: Enhanced VB Tabbed Web Browser
that is fine :)
my panic is not yours LOL
thank you for taking the time! :)
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
good morning Gary :)
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 :)
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. :)
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! :)
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 :)..LOL the biggest part about learning is figuring out where ya screwed up at eh??? hehehheheheeeee ( I apparently did a dooooooooooozey!)
-
Re: Enhanced VB Tabbed Web Browser
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 :)
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
Yes thankyou ive done it :)
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
Emcrank
Yes thankyou ive done it :)
Glad to hear it!!
-
Re: Enhanced VB Tabbed Web Browser
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 ???
-
Re: Enhanced VB Tabbed Web Browser
Interesting, let me take a look at this, and I will post back.
Gary
-
Re: Enhanced VB Tabbed Web Browser
I solved using this code before removing Tab.
Quote:
CType(tabs_control.SelectedTab.Controls.Item(0), GeckoWebBrowser).Dispose()
tabs_control.TabPages.Remove(tabs_control.SelectedTab)
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
may be i omit. but this code work for me.
-
Re: Enhanced VB Tabbed Web Browser
So to be clear, you are modifying the existing code. is that right?
Where did you put the above code?
Gary
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
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.
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
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.
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
MrTree
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
-
1 Attachment(s)
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
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.
With the solution built, and the main form open in the designer, you should see the following:
Attachment 80370
Gary
-
1 Attachment(s)
Re: Enhanced VB Tabbed Web Browser
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:
-
Re: Enhanced VB Tabbed Web Browser
Do you have the form open in design mode when you are trying?
Gary
-
Re: Enhanced VB Tabbed Web Browser
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
I am running the extracted vesion of your project which I have redownloaded just in case. But still does not work.
-
Re: Enhanced VB Tabbed Web Browser
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?
-
Re: Enhanced VB Tabbed Web Browser
So...
What did you do differently to get my project working?
What have you done to bring the user controls into your project?
Gary
-
Re: Enhanced VB Tabbed Web Browser
Right click on the project name in the solution explorer, and then click Add > Existing Item... then select your WebBrowserTabControl.vb and WebBrowserTabPage.vb
-
Re: Enhanced VB Tabbed Web Browser
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
-
1 Attachment(s)
Re: Enhanced VB Tabbed Web Browser
It seems like it has worked but its now saying:
If its any help im running Windows 7 Ultimate 64-bit
-
Re: Enhanced VB Tabbed Web Browser
Ignore this, its now fixed it self, thank you very much :D I can now use your WebBrowserTabControl, thank you.
-
Re: Enhanced VB Tabbed Web Browser
Hey,
Glad to hear it!!
Gary
-
Re: Enhanced VB Tabbed Web Browser
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
coolcurrent4u
@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 :)
Gary
-
1 Attachment(s)
Re: Enhanced VB Tabbed Web Browser
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
Code:
Value of '10026' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'. Parameter name: Value
the image below show it exact
-
Re: Enhanced VB Tabbed Web Browser
Hello,
Are you able to provide a complete step of steps to reproduce this issue?
Thanks
Gary
-
Re: Enhanced VB Tabbed Web Browser
Hello,
Are you able to provide a complete step of steps to reproduce this issue?
Thanks
Gary
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
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.
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
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.
Sounds like a plan! Let me know if you have any issues, or whether you add anything interesting.
Gary
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
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
I haven't forgotten about this issue, I just haven't had a chance to look at it yet.
Gary
-
Re: Enhanced VB Tabbed Web Browser
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.
-
Re: Enhanced VB Tabbed Web Browser
Hello Grunt,
Sounds interesting! Will be good to see how you get on.
Gary
-
Re: Enhanced VB Tabbed Web Browser
Hi,
First of, I would like to give you a well done :) 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. :)
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
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
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
-
Re: Enhanced VB Tabbed Web Browser
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
-
Re: Enhanced VB Tabbed Web Browser
Quote:
Originally Posted by
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 :(
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
-
Re: Enhanced VB Tabbed Web Browser
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?