Make links open up in a new tab and not in IE
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
7 posts
Page 1 of 1
I am using VB 2008 and I have been in the process of my own web browser and I need to know how to right click on a link and click on new window for it to pop up in new window or new tab. Does any one know how to do this?
Sincerely,
Harley
[Information Technologist in training, New to the whole VB coding]
Harley
[Information Technologist in training, New to the whole VB coding]
Try this:
Code: Select all
I did not test this code, so i hope it helps!Private Sub WebBrowser1_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
Dim VarName as Uri
e.Cancel = True
VarName = e.Url
'Do what you need to do with VarName to make it open in a new tab/window
End Sub
It does in some cases, but it really doesn't solve my problem, when I click on a link in my browser the open in a new tab option in disabled and open to a new windows is enabled, but it opens it in IE and not the browser I am making, is there a way to change that?
Sincerely,
Harley
[Information Technologist in training, New to the whole VB coding]
Harley
[Information Technologist in training, New to the whole VB coding]
Make yours from scratch
I'm half way in mine and that is built from scratch!

LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Try this.
Code: Select all
You will need to edit it to work with tabsDim htmlElement1 As HtmlElement = WebBrowser1.Document.ActiveElement
Dim s1 As String = htmlElement1.GetAttribute("href")
WebBrowser1.Navigate(s1)
Visit BW Photography and check out my photos!
thanks cooll;
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

You wall also have to add e.Cancel = true to your code i think :P
7 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023