Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I add a hyperlink to a RichTextBox control?

To add a hyperlink to the RichTextBox, so that it opens up the link you click on, ensure that DetectUrls property is set to true and call:

[C#]

private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
{
  System.Diagnostics.Process.Start( e.LinkText );
}

[Visual Basic]

Private Sub richTextBox1_LinkClicked(ByVal sender As Object, _
    ByVal e As LinkClickedEventArgs)
  System.Diagnostics.Process.Start(e.LinkText)
End Sub

Contributed from George Shepherd's Windows Forms FAQ



Page view counter