.net – RichTextBox in VB.NET

vb.net

I want set a line of text link in rich text box of vb.net. Like for example: I want to know you

The word want, I want to set a link word.

Can I do that?

Best Solution

This is how I would do it.

Dim linkLa As New LinkLabel
linkLa.LinkColor = Color.Red

Dim link As LinkLabel.Link = linkLa.Links.Add(0, 13, "http://www.stackoverflow.com")
linkLa.Text = "Stackoverflow"
AddHandler linkLa.LinkClicked, AddressOf Link_Clicked

richTextBox1.Controls.Add(linkLa)

Private Sub Link_Clicked(ByVal sender As Object, ByVal e As EventArgs)
    MessageBox.Show("clicked")
End Sub 
Related Question