Search code examples
delphirichedit

Keeping the caret at the end of text in a rich edit


I am writing an editor in Delphi (2009) using a TRichEdit component. The editor is append-only, in the sense that the caret must be at the end at all times, while maintaining the ability to copy using the mouse from elsewhere in the component.

The way it is working at the moment is by moving the caret to the end whenever something is written, but is it possible to make the caret not follow the mouse when clicking at other parts of the text?


Solution

  • No, it is not possible. You have to move the caret to the end when the user types something.