2

I'm having a TRichEdit control into which I'm continuously adding lines. The problem is that when the control is focused, it automatically scrolls to the end whenever a line is added.

How can I stop the scrollbar to move to the end when lines are added? How to prevent auto-scrolling of a focused TRichEdit when adding new lines?

TLama
  • 75,147
  • 17
  • 214
  • 392
JO SeongGng
  • 567
  • 3
  • 18
  • So you want to auto-scroll down, or not ? If yes, then there's e.g. [`this duplicate`](http://stackoverflow.com/q/6372193/960757). – TLama May 19 '15 at 16:30
  • @TLama no and yes. after i check the past lines i will scroll down manually and then the scroll downs automatically again as did. it's perfectly same with a mobile messenger. thanks. – JO SeongGng May 19 '15 at 16:44
  • @TLama: no, Jo wants to disable auto-scrolling, so he can keep reading existing lines while new lines are being added. – Remy Lebeau May 19 '15 at 16:44
  • 1
    Then I'm still confused, @Remy. That [other question](http://stackoverflow.com/q/6372193/33732) asked how to achieve auto-scrolling. Here, we're asked how to suppress auto-scrolling. Has the default behavior changed, or is one of these askers confused about what he or she is observing? – Rob Kennedy May 19 '15 at 16:52
  • @TomBrunberg jeez. i have spent the whole day with wm_vScroll, GetScrollPos, SetScrollPos ... the focus and the tap stop was the key. i deeply appreciate tom. how can i close this stupid question? – JO SeongGng May 19 '15 at 17:25
  • @TLama i didn't asked that i had a problem when tRichEdit is focused. by focusing out the problem has been solved. always thanks. – JO SeongGng May 20 '15 at 01:02
  • @JO, if there is no auto-scrolling if the control is not focused, then what you need to ask ? You were hiding the fact that you are talking about the focused control from us (hence some of us were confused). – TLama May 20 '15 at 07:03
  • @TLama i didn't hide anything. i just didn't know that the focus is related to the auto scroll. – JO SeongGng May 20 '15 at 07:07
  • @JO, I see that not intentionally. But it's crucial to mention that the control has been focused. I didn't know that rich edit does auto-scrolling (when it's focused). – TLama May 20 '15 at 07:20

1 Answers1

2

Remove focus from the RichEdit to stop the auto-scrolling, set focus to the RichEdit to start auto-scrolling.

Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54