Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to click on a link

How to click on a link

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SekharOne
    wrote on last edited by
    #1

    Hi All I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link. I have written the code as bellow : Dim link1 As mshtml.HTMLLinkElement link1 = WebBrowser1.Document.Links(10) Now How can I click the link link1 to navigate to the link. Please Help. Thanks in advance.

    J 1 Reply Last reply
    0
    • S SekharOne

      Hi All I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link. I have written the code as bellow : Dim link1 As mshtml.HTMLLinkElement link1 = WebBrowser1.Document.Links(10) Now How can I click the link link1 to navigate to the link. Please Help. Thanks in advance.

      J Offline
      J Offline
      John_Adams
      wrote on last edited by
      #2

      Hi, On the Webrowser's click event try link1.Navigate(URLstring). Hope this helps.

      Regards, John Adams ComponentOne LLC

      S 1 Reply Last reply
      0
      • J John_Adams

        Hi, On the Webrowser's click event try link1.Navigate(URLstring). Hope this helps.

        Regards, John Adams ComponentOne LLC

        S Offline
        S Offline
        SekharOne
        wrote on last edited by
        #3

        Thanks Adams for your response. My problem is when I assign the link in the line link1 = WebBrowser1.Document.link(10) it doesn't produce any output and the immediate line after this line also doen't gets executed. I think some errors occur in this line and the compiler is not able to track it. for which the focus goes to the exe after this line gets executed. If you can help me out in solving the problem, it will be a great help. Thanks in advance.

        Sekhar :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups