Im trying to check and see if the right clicks on a link in a webbrowser, if so enable a button on the contextmenustrip that allows him to open it in a different tab.
Dim Oelement as HTMLelement
Private Sub ContextMenuStrip1_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening
If oElement.TagName = "A" Then
mnuLink.Enabled = True
Else
mnuLink.Enabled = False
End If
End Sub
Private Sub mnuLinkNewTab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuLinkNewTab.Click
Dim ofrm As New frmBrowser
AppManager.AddTab(ofrm, oElement.GetAttribute("HREF"))
End Sub
That code works on some links, but not others. Two examples would be on the bottom of Yahoo! (
http://www.yahoo.com) homepage, where it says featured services, none of those links work, but where it says Do business with us, all of them work.
Can I please ask someone to explan the problem and provide some visual code.