How do I insert a hyperlink into the text inside a TRichEdit control in Delphi?

Posted on 2010-01-12
Medium Priority
Last Modified: 2012-08-13
Hello Experts,

What I want to do is to give the user the facility to insert a reference to a document in the middle of some free text - the reference is sensitive to 'MouseOver' and 'OnClick' events;

For example, the user will type "The company safety policy consists of " and then he/she will click a button to insert a reference at the last carat position. The text now reads..."The company safety policy consists of RIDORR Sections 1 to 5" where "RIDORR Sections 1 to 5" is the reference that is mouse-sensitive.

I want the reference to change colour when the mouse is hovering over it and when the user clicks on the reference I will call up another Form to display the content of the reference. To do all this requires first of all that the reference is somehow made mouse-sensitive. Added to this, the string that forms the reference has to act as a single character when it comes to deletion - the user will delete the whole string with a single 'backspace' keystroke, no partial deletion of the reference is allowed.

This looks very difficult hence the high tariff.

I would consider using a TMemo control instead of TRichEdit if that makes it easier.

Thanks in advance.
Question by:SteveFarndon2000
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Accepted Solution

Johnjces earned 1500 total points
ID: 26293509
I think that this link to delphi.about.com will satisfy your need to have an RTF in a rich edit control.



Author Closing Comment

ID: 31676100
Dealt with the issue of creating a mouse-sensitive piece of text but not the requirement ot insert text at the carat position.
Would have prefered to reduce the points but can't see how to do this.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question