How do I save and restore the current scroll position in a TRichEdit component?

First, a brief description of the problem: Assume that you are writing a chat room program. As new messages are a posted in the chat room, you want to append them to the text in the control. However, to do this, you must position the caret at the bottom of the text and then insert the text.

Finally, you need to restore the original caret position (easy) and scroll back such that the top line displayed is the same one as before inserting the text (not so easy). Here is a trick posted by Peter Below (TeamB) in a Delphi forum. I have translated, modified, and expanded the original post somewhat for presentation here.

Hopefully, I have not munged it too badly. More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions