-4

I just learning c# can you help me? I trying this -> richTextBox1.Text = "https://www.google.com"; I actually see this text and it's clickable, but when I click on it nothing happens. How I add the event to this link so it's will open a link?.

Also, how can I convert this link like present text "Google" and inside event to open "https://www.google.com";

I know how to do Process.Start but I don't know how to insert this to richTextBox.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • Does the rich text box use HTML? Are you just asking how to make an HTML link? Something else? What on Earth does `Process.Start` have to do with this? – David Jun 09 '18 at 13:50
  • You better start from here: https://stackoverflow.com/help/how-to-ask, then continue by fixing your questions' subject to represent a real question, and then fix the question itself. Ideally showing a concise piece of code. – Ondrej Tucny Jun 09 '18 at 13:52

1 Answers1

1

Or simply :

go to richTextBox Properties, set the DetectUrls property to true

then in the LinkClicked event :

private void richTextBox1_LinkClicked (object sender, LinkClickedEventArgs e) {
    System.Diagnostics.Process.Start(e.LinkText);
}
Kaj
  • 806
  • 6
  • 16