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. C#
  4. WebBrowser Control

WebBrowser Control

Scheduled Pinned Locked Moved C#
htmlhelpquestion
6 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.
  • Z Offline
    Z Offline
    zaboboa
    wrote on last edited by
    #1

    Hello, I am using a WebBrowser control, that is there to display the HTML file. It has some links. The problem is, I don't want those links to change the colour when user clicks on them. I supress the link from poping up, but the colour on the hyperlink changes. Is there a way of keeping the same blue colour? Thank you.

    R 1 Reply Last reply
    0
    • Z zaboboa

      Hello, I am using a WebBrowser control, that is there to display the HTML file. It has some links. The problem is, I don't want those links to change the colour when user clicks on them. I supress the link from poping up, but the colour on the hyperlink changes. Is there a way of keeping the same blue colour? Thank you.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Here's a style fragment that will cause the hyperlink to always render in blue:

      A:link { color: #0000FF; text-decoration: none; }
      A:visited { color: #0000FF; text-decoration: none; }
      A:hover { color: #0000FF; text-decoration: underline }
      A:active { color: #0000FF; text-decoration: none }

      /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      Z 1 Reply Last reply
      0
      • R Ravi Bhavnani

        Here's a style fragment that will cause the hyperlink to always render in blue:

        A:link { color: #0000FF; text-decoration: none; }
        A:visited { color: #0000FF; text-decoration: none; }
        A:hover { color: #0000FF; text-decoration: underline }
        A:active { color: #0000FF; text-decoration: none }

        /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        Z Offline
        Z Offline
        zaboboa
        wrote on last edited by
        #3

        Yeah, but this has to be done in the document itself. I guess there is no property on the control itself to control the hyperlink colours. Thanks.

        R 1 Reply Last reply
        0
        • Z zaboboa

          Yeah, but this has to be done in the document itself. I guess there is no property on the control itself to control the hyperlink colours. Thanks.

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          If you're programatically navigating the control to a URI, you could modify the HTML (i.e. inject an inline internal style) before setting the web browser control's content. /ravi

          This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          Z 1 Reply Last reply
          0
          • R Ravi Bhavnani

            If you're programatically navigating the control to a URI, you could modify the HTML (i.e. inject an inline internal style) before setting the web browser control's content. /ravi

            This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

            Z Offline
            Z Offline
            zaboboa
            wrote on last edited by
            #5

            Don't I need a style sheet for that? Or I can do it the same way I am setting the background colour for the webbrowser control. How would the HTML contents look like? Thank you.

            R 1 Reply Last reply
            0
            • Z zaboboa

              Don't I need a style sheet for that? Or I can do it the same way I am setting the background colour for the webbrowser control. How would the HTML contents look like? Thank you.

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #6

              Sorry, I meant an internal[^] style, not an inline style. /ravi

              This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

              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