1

I want to navigate to new tab when click on anchor. My code : Hide Copy Code

Dim elements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("a")
For Each pElem As HtmlElement In elements
  If (pElem.GetAttribute("HREF") <> "" AndAlso pElem.GetAttribute("HREF") <> "#" Then
     WebBrowser1.AllowNavigation = True
     pElem.SetAttribute("target", "_Blank")
     pElem.InvokeMember("click")
  End If
Next

When i Perform Click it will open in IE Browser instead of Web-Browser Control. Please brief me what I am doing wrong?

FYI, Instead of Navigate using URL i want to Navigate Using click and its compulsory.

Thanks in advance.

Jems fams
  • 11
  • 1
  • you can check http://stackoverflow.com/questions/5312275/open-new-web-page-in-new-tab-in-webbrowser-control – volody Dec 04 '15 at 03:35

0 Answers0