简体   繁体   中英

how to make any text in richtext box as hyperlink

I am having text in rich text box separated with ';' I want to make every value as hyperlink which is separated with ';'. Please Help

Have a look at the article here. It shows how to enable hyperlinks in a richtext box http://msdn.microsoft.com/en-us/library/f591a55w.aspx

  1. To link to a Web page with the RichTextBox control
  2. Set the Text property to a string that includes a valid URL (for example, " http://www.microsoft.com/ ").
  3. Make sure the DetectUrls property is set to true (the default).
  4. Create a new global instance of the Process object.
  5. Write an event handler for the LinkClicked event that sends the browser the desired text.

Do you mean you have many URLs in rich textbox but they are not shown as links?

Check the DetectUrls property to true.

If you have arbitrary text that should be converted to links take a look at: http://www.codeproject.com/Articles/9196/Links-with-arbitrary-text-in-a-RichTextBox

To react to user interaction with such a link, as already posted: http://msdn.microsoft.com/en-us/library/f591a55w.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM