tags:

views:

32

answers:

1
+1  Q: 

RichTextBox

Hi All,

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? If can, please help me!

Thanks, Sopolin

+1  A: 

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
Stan R.
I accept your answer, but I want show the link address.
Sopolin
you could simply just set richTextBox1.DetectUrls = true and then just enter your address as plain text. Or change linkLa.Text to the address instead of the text.
Stan R.