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. urls in a richtextbox

urls in a richtextbox

Scheduled Pinned Locked Moved Visual Basic
htmldatabasecomdebuggingquestion
4 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.
  • K Offline
    K Offline
    KaptinKrunch
    wrote on last edited by
    #1

    I have the following event handler for a rich text box. Protected Sub Link_Clicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles rtbDescription.LinkClicked Try System.Diagnostics.Process.Start(e.LinkText) Catch ex As Exception Debug.WriteLine(ex.Message & " : " & e.LinkText) End Try End Sub When I click a link in the rich text box nothing happens an I receive the following line in my output. The system cannot find the path specified : http://www.cnn.com/rssclick/2005/TECH/internet/07/28/disappearing.apple.ap/index.html?section=cnn\_tech Anyone have any ideas? MSDN states that this handler should fire the default browser.

    D 1 Reply Last reply
    0
    • K KaptinKrunch

      I have the following event handler for a rich text box. Protected Sub Link_Clicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles rtbDescription.LinkClicked Try System.Diagnostics.Process.Start(e.LinkText) Catch ex As Exception Debug.WriteLine(ex.Message & " : " & e.LinkText) End Try End Sub When I click a link in the rich text box nothing happens an I receive the following line in my output. The system cannot find the path specified : http://www.cnn.com/rssclick/2005/TECH/internet/07/28/disappearing.apple.ap/index.html?section=cnn\_tech Anyone have any ideas? MSDN states that this handler should fire the default browser.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Try it like this:

      Dim proc As New Process()
      With proc
      .StartInfo.FileName = e.LinkText
      .StartInfo.UseShellExecute = True
      .Start()
      End With

      I would appear that Process is not using Shell Execute for some reason, so, force it to do so. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      K 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Try it like this:

        Dim proc As New Process()
        With proc
        .StartInfo.FileName = e.LinkText
        .StartInfo.UseShellExecute = True
        .Start()
        End With

        I would appear that Process is not using Shell Execute for some reason, so, force it to do so. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        K Offline
        K Offline
        KaptinKrunch
        wrote on last edited by
        #3

        I have modified my code as you suggested, yet I get the same response. The system cannot find the path specified : http://www.cnn.com/rssclick/2005/WORLD/africa/07/28/niger.nomads.email.ap/index.html?section=cnn\_tech Protected Sub Link_Clicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles rtbDescription.LinkClicked Try Dim proc As New Process() With proc .StartInfo.FileName = e.LinkText .StartInfo.UseShellExecute = True .Start() End With 'System.Diagnostics.Process.Start(e.LinkText.ToString) Catch ex As Exception Debug.WriteLine(ex.Message & " : " & e.LinkText) End Try End Sub

        D 1 Reply Last reply
        0
        • K KaptinKrunch

          I have modified my code as you suggested, yet I get the same response. The system cannot find the path specified : http://www.cnn.com/rssclick/2005/WORLD/africa/07/28/niger.nomads.email.ap/index.html?section=cnn\_tech Protected Sub Link_Clicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles rtbDescription.LinkClicked Try Dim proc As New Process() With proc .StartInfo.FileName = e.LinkText .StartInfo.UseShellExecute = True .Start() End With 'System.Diagnostics.Process.Start(e.LinkText.ToString) Catch ex As Exception Debug.WriteLine(ex.Message & " : " & e.LinkText) End Try End Sub

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I have no idea what's going on. That's very same code works perfectly for me. Perhaps this registry key is screwed up? -> HKEY_CLASSES_ROOT\http. You might want to check to see if anything is registered under http\Shell\Open\Command. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          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