Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:15:18+00:00 2026-05-24T18:15:18+00:00

I have a RichTextBox, when users type their text, quite often they enter links

  • 0

I have a RichTextBox, when users type their text, quite often they enter links to some pages. What I want to do is to detect the link and make it a real hyperlink – highlight it, underline it and make it clickable. This should works for two scenarios:

  • when user types the link manually (so when a KeyDown event is raised)
  • when link is added to the RichTextBox using “paste” functionality

I found the following link: http://forum.phux.org/viewtopic.php?f=18&t=78 but it does not fulfill all the requirements (for instance, the hyperlink is not clickable and the Regex for detecting links has some lacks (e.g. it doesn’t recognize https)
Can someone please help me to find out how to make the hyperlink clickable and how to extend the Regex to fulfill all the requirements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:15:19+00:00Added an answer on May 24, 2026 at 6:15 pm

    “(http|https)://([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\’\,]*)?”

    its for http/https. You can add ftp, files:/// etc the same way.

    to make hyperlink clickable you can do somthing like that:

    FlowDocument myFlowDoc = new FlowDocument();
    // Add hyperlink to the FlowDocument.
    myFlowDoc.Blocks.Add(new Hyperlink(new Run(MatchedText)));
    

    where MatchedText – is the result of Regex. But not just Add(), you should to find start and end position of Matched text and perform with it action like above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RichTextBox which contains links posted by the users. The problem is
I have a richtextbox that its text is a concatenation of some words from
I want my users to be able to enter text in a Rich Text
I have a simple vb6 editor type application which has a richtextbox as the
I have a System.Windows.Forms.RichTextBox that I wish to use to display some instructions to
We have a Silverlight application using the RichTextBox as a rich text editor for
Hi all I wanted to allow the users to enter html and links in
In my application's form, I have two RichTextBox objects. They will both always have
how to filter CTRL + V in richTextBox? I have richtextbox with text blabla
Basically, I have a RichTextBox and I want to convert the formatted contents of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.