Share via

CRichEditCtrl Subclass to add resize handle??

Andre LeBlanc 21 Reputation points
2022-08-05T00:55:57.107+00:00

I am trying to subclass the CRichEditCtrl class in MFC. When overriding the OnPaint function no text shows while typing and artifacts appear - happens when CPaintDC is defined. When the CPAintDC is commented out and base class CRichEditCtrl::OnPaint() is called, everything works as default. I'm trying to draw a resize handle on the right edge of the rectangle/border. Please help!!!

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


1 answer

Sort by: Most helpful
  1. Minxin Yu 13,516 Reputation points Microsoft External Staff
    2022-08-09T01:22:29.203+00:00

    Hi, @Andre LeBlanc

    Try to paint in WM_NCPAINT event. It is also needed to remove OnPaint and redraw edit border.

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.