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
Printable View
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
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
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
Thanks, but i can't use it in .net 2.0 as it uses linq
Hello,
One line of that code sample uses LINQ. It should be simple enough to factor LINQ out.
Gary
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
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?
Quote:
myFav.Url = New Uri(sb.ToString())"
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
Hi,
This is the just copying the text from the unhandled exception.
Adding a break point say the following:Quote:
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)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
Quote:
Live Event: Breakpoint Hit: GetFavouritesForDirectory, MainWindow.VB line 42 A Breakpoint or tracpoint was hit by the debugger" Thread Main 8060.
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
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
Attachment 99417Attachment 99419
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?
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
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"
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
Sorry for the late reply. here is the information you required.
Attachment 99499
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
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.
Attachment 99501Attachment 99503Attachment 99505Attachment 99507
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
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?
Doh! :)
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
Well, I checked it out. I may be able to use some methods regarding favorites (favourites :) ). 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...
Cool, hopefully it will be of some use.
Feel free to fork the code, and make any updates :)
Gary
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
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
If you add to the end of "favourites)"Code:' For Each dirName In Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
Then it shows everything but then nothing is in folders and everything has a + symbol against it.Code:"*.url", SearchOption.AllDirectories)
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 :)
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 :)
Gary
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.
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
Just checked in basic fix. :)
Just tried it, works perfectly :) 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 :)
Code: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
Not a problem at all.
Happy to help. Let me know if there are any other feature suggetions, or bugs.
Gary
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
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
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