0

I'm trying to insert a hyperlink in Rich textbox but when I click the link my it's doesnt go to it's Google


Dim link As New LinkLabel()

link.Text = "something"

     Dim Data As New LinkLabel.Link()
       Data.LinkData = "www.google.com"

       link.Links.Add(Data)
       link.AutoSize = True

       RichTextBox1.GetPositionFromCharIndex(RichTextBox1.TextLength)
       RichTextBox1.Controls.Add(link)
       RichTextBox1.AppendText(link.Text + "   ")
       RichTextBox1.SelectionStart = RichTextBox1.TextLength
  • 1
    The RichTextBox can handle links. See the DetectURL property and use the LinkClicked event. – LarsTech May 21 '20 at 22:23
  • What I want to happen is when I type "something" then click it I will go to Google.com – Christian Joshua Mendigoria May 21 '20 at 22:49
  • 1
    Doesn't change my comment. Your way of adding a LinkLabel to the RichTextBox.Controls collection is problematic. Avoid that. See [How can I make a hyperlink work in a RichTextBox?](https://stackoverflow.com/q/435607/719186). – LarsTech May 21 '20 at 22:53

0 Answers0