简体   繁体   中英

RichEdit paint background

I know how to change the background on a single row in a TRichEdit control. But because this is applied to the selected text only, I can't set the background color of the whole line (client left to client right), only to the text part.

I tried to use the WM_ERASEBKGND message, but it doesn't work because a RichEdit control is painting the background in its WM_PAINT handler.

I also tried to set the brush to bsClear before calling the WM_PAINT handler, but it didn't work either.

Is it possible at all to have a custom drawn background?

您将可以使用EM_SETBKGNDCOLOR消息来做到这一点

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM