Page 1 of 1

Problems with RichEdit20A

Posted: Fri Aug 13, 2004 10:22 pm
by Kazmirzak
Hy everyone!

I'm writing an editor with simple color highlighting. My program checks a single line, sets the selection to a word (#EM_EXSETSEL) and changes the color of the selection with the command #EM_SETCHARFORMAT.

Everything works fine with "RichEdit", but with "RichEdit20A", the screen scrolls to the selection, so when you write something on the beginning of a long line, and this changes the color on the middle of the line, the screen begins to jump around and you get really confused! BTW I want to use RichEdit20A because it supports multiple UNDO. So is there a possibility to "tell" the RichEdit20A that it shouldn't scroll to the current selection, like the good old "RichEdit" ?

Posted: Fri Aug 13, 2004 11:04 pm
by freak
use this line to disable the scrolling feature before you do the hilightning:

Code: Select all

SendMessage_(hRichEdit, #EM_SETOPTIONS, #ECOOP_XOR, #ECO_AUTOHSCROLL)
and this one to enable it again afterwards:

Code: Select all

SendMessage_(hRichEdit, #EM_SETOPTIONS, #ECOOP_OR, #ECO_AUTOHSCROLL)
Timo