Rtf

lothos12345

Junior Contributor
Joined
May 2, 2002
Messages
294
Location
Texas
I have an rtf that is filled with text from a database. Every so often a hyper is in the text and the rtf detects the hyperlink and it looks like a hyper link however when you click on it nothing happens not sure why. This is a visual basic.NET application. Any help would be greatly appreciated.
 
Visual Basic:
Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles RichTextBox1.LinkClicked

System.Diagnostics.Process.Start(e.LinkText)

End Sub

-=Simcoder=-
 
RTF (rich text format) is a text format.
RTB (rich text box) is the box that holds the RTF.

To catch the link clicking inside of the RTB, you have to handle the RTB's LinkClicked event.
In the LinkClicked event, the e.LinkText contains the hyperlink URL.
With this URL, you call System.Diagnostics.Process.Start(the url goes here) and it will popup the default browser to this webpage.
 
Back
Top