Win Coder
Win Coder

Reputation: 6756

How to open a new browser window after clicking on a link in rich text box(C#)

i have a twitter application that retrieves user timeline and appends it to a rich text box. However when i click the links nothing happens ?

What's wrong here doesn't rich text box automatically handles the creation of new broswer windows with the specified link. If not then how can i implement such functionality ?

and i am using winforms.

Upvotes: 3

Views: 2713

Answers (2)

sajanyamaha
sajanyamaha

Reputation: 3198

First You have set DetectUrls property set to True

Then

RichTextBox1_LinkClicked(System.Object sender, System.Windows.Forms.LinkClickedEventArgs e)
{
    Process.Start(e.LinkText);
    //open link with default application
}

Also see this link for more.

Upvotes: 8

AmazingDreams
AmazingDreams

Reputation: 3204

What worked for me:

Process.Start("http://www.example.com/");

This will open the link in the users default browser.

Upvotes: 0

Related Questions