I have tried you Radrichtextbox with the hyperlink, however, the behaviour of the control is not as expected for the following reasons:
1- The HyperlinkNavigationMode is set to click - however one still has to CtrlClick
2- In Private Sub RadRichtextbox_Hyperlinkclicked -- e.handled is set to true - however an external browser is still opened. I just want to show the URL in a messagebox.
My project details:
Form with one radbutton control and one radrichtextbox control
My code:
1- The HyperlinkNavigationMode is set to click - however one still has to CtrlClick
2- In Private Sub RadRichtextbox_Hyperlinkclicked -- e.handled is set to true - however an external browser is still opened. I just want to show the URL in a messagebox.
My project details:
Form with one radbutton control and one radrichtextbox control
My code:
Imports Telerik.WinControls.RichTextBox.FileFormats.Html
Imports Telerik.WinControls.RichTextBox.Model
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.RadRichTextBox1.HyperlinkNavigationMode = Telerik.WinControls.RichTextBox.HyperlinkNavigationMode.Click
Me.RadRichTextBox1.IsReadOnly = True
End Sub
Private Sub RadButton1_Click(sender As System.Object, e As System.EventArgs) Handles RadButton1.Click
Dim provider As New HtmlFormatProvider
Dim text_for_radrichtextbox As String = ""
Me.RadRichTextBox1.Document = New RadDocument
text_for_radrichtextbox = "<
p
>1. This is the text for the rad richtextbox <
a
href
=
" & Chr(34) & "
http://www.telerik.com" & Chr(34) & ">Link text to Telerik</
a
>.</
p
>"
Me.RadRichTextBox1.Document = provider.Import(text_for_radrichtextbox
End Sub
Private Sub RadRichTextBox1_HyperlinkClicked(sender As Object, e As Telerik.WinControls.RichTextBox.Model.HyperlinkClickedEventArgs) Handles RadRichTextBox1.HyperlinkClicked
e.Handled = True 'to stop the external browser from opening
MessageBox.Show(e.URL) 'to show the URL
End Sub
End Class