Results 1 to 8 of 8

Thread: Rich Textbox URLS

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Rich Textbox URLS

    Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!

    John

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Rich Textbox URLS

    Quote Originally Posted by JohnRChick
    Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!

    John
    Hi,

    I think you cab do it in another way.
    Create a LinkLabel in your RTB and name it like your URL.
    See this code:

    VB Code:
    1. Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
    2.         TextBox1.Text = "Hello there"
    3.     End Sub

    Hope it helps,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Rich Textbox URLS

    hmm but the thing is that then the link away stays where you put it in the text box.. my url is at the bottom so its only visible when the user scrolls down

  4. #4
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Rich Textbox URLS

    Quote Originally Posted by JohnRChick
    hmm but the thing is that then the link away stays where you put it in the text box.. my url is at the bottom so its only visible when the user scrolls down
    I found a link about URL's

    http://www.vbforums.com/showthread.p...hlight=url%27s

    Hope it's better

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Rich Textbox URLS

    uhh that doesn't really help haha any more ideas

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Re: Rich Textbox URLS

    any ideas...

  7. #7
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: Rich Textbox URLS

    Quote Originally Posted by JohnRChick
    Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!

    John
    Hi John,

    Yes I know It's me again, and again with a few links, but this time you'll find
    some explanation about LinkControl;

    http://msdn.microsoft.com/library/de...inkControl.asp

    http://msdn.microsoft.com/library/de...inkControl.asp

    http://msdn.microsoft.com/library/de...inkcontrol.asp

    I hope it really helps you this time!

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  8. #8
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Rich Textbox URLS

    The RichTextBox has a LinkClicked event where you would handle what you want to do when a link is clicked.

    An example from documentation:
    VB Code:
    1. Public p As New System.Diagnostics.Process
    2. Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) _
    3.    Handles RichTextBox1.LinkClicked
    4.       ' Call Process.Start method to open a browser
    5.       ' with link text as URL.
    6.       p = System.Diagnostics.Process.Start("IExplore.exe", e.LinkText)
    7. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width